Sense Ahead 1 3 Food ; state 0: [SEARCH] is there food in front of me? Move 2 0 ; state 1: YES: move onto food (return to state 0 on failure) PickUp 8 0 ; state 2: pick up food and jump to state 8 (or 0 on failure) Flip 3 4 5 ; state 3: NO: choose whether to... Turn Left 0 ; state 4: turn left and return to state 0 Flip 2 6 7 ; state 5: ...or... Turn Right 0 ; state 6: turn right and return to state 0 Move 0 3 ; state 7: ...or move forward and return to state 0 (or 3 on failure) Sense Ahead 9 11 Home ; state 8: [GO HOME] is the cell in front of me my anthill? Move 10 8 ; state 9: YES: move onto anthill Drop 0 ; state 10: drop food and return to searching Flip 3 12 13 ; state 11: NO: choose whether to... Turn Left 8 ; state 12: turn left and return to state 8 Flip 2 14 15 ; state 13: ...or... Turn Right 8 ; state 14: turn right and return to state 8 Move 8 11 ; state 15: ...or move forward and return to state 8