


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | while ( true ) { if (atLeaf()) // first location check { eatLeaf(); move(); } else { turnLeft(); turnLeft(); move(); turnRight(); move(); // repeat lines 3 through 14 here -- second location check // repeat lines 3 through 14 here -- third location check // repeat lines 3 through 9 here -- last location check stop(); break ; // exits loop (to exit method) } } } } } |