While Kara is not on a leaf, he attempts to walk straight ahead. When there is a tree in front of him, he walks around it.
public void myProgram() {
while (! kara.onLeaf()) {
if (kara.treeFront()) {
kara.turnLeft();
kara.move();
kara.turnRight();
kara.move();
kara.move();
kara.turnRight();
kara.move();
kara.turnLeft();
}
else {
kara.move();
}
}
kara.removeLeaf();
}