|
1. Zig-zag with multiple clicks... face("s") 2. Zig-zag with one click... face("s") 3. Cut entire yard with multiple clicks... if(pathIsClear() && nextNeedsToBeCut()){
4 Cut entire yard with one click. while(moreToCut()){if(pathIsClear() && nextNeedsToBeCut()){ move() } else{ turnLeft() } } 5. Clear entire yard when starting in the center of the yard at 5,5 (this approach is complicated...you can probably write much simpler code)... i = 1while (i < 9){ j = 0 while (j < i) { move() j= j+1 } j=0; turnLeft() while (j < i) { move() j= j+1 } turnLeft() i= i+1 } while (pathIsClear()) { move() } |