Tuesday, February 12, 2008

GvR Crowded Maze code

define turnaround: do 2: turnleftdefine turnright: do 3: turnleftdefine backup: do 2: turnleft move do 2: turnleft define solve: move if next_to_a_beeper: pickbeeper if front_is_clear: solve if left_is_clear: turnleft solve turnright if right_is_clear: turnright solve turnleft backupwhile front_is_clear: moveturnaroundif next_to_a_beeper: pickbeepersolveturnoff

No comments: