Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // if room dimenion is known to us we're sitting at the bottom right corner
  2. if(bump && foundDim){
  3. //if we are facing east - perform a left turn and face north
  4. if(state.agent_direction == state.EAST){
  5. state.agent_direction = state.NORTH;
  6. return turnL;
  7. }
  8. // if we are facing south - perform a right turn and face west
  9. else if (state.agent_direction == state.SOUTH){
  10. state.agent_direction = state.WEST;
  11. return turnR;
  12. }
  13. // if we are neither facing south or east - just move forward
  14. else
  15. return LIUVacuumEnvironment.ACTION_MOVE_FORWARD;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement