Kara walks straight ahead until there is a tree to his left and right. Then he continues until there no tree either to his left or right.
while (! (kara.treeLeft() && kara.treeRight())) { kara.move(); } while (kara.treeLeft() && kara.treeRight()) { kara.move(); }