Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // if room dimenion is known to us we're sitting at the bottom right corner
- if(bump && foundDim){
- //if we are facing east - perform a left turn and face north
- if(state.agent_direction == state.EAST){
- state.agent_direction = state.NORTH;
- return turnL;
- }
- // if we are facing south - perform a right turn and face west
- else if (state.agent_direction == state.SOUTH){
- state.agent_direction = state.WEST;
- return turnR;
- }
- // if we are neither facing south or east - just move forward
- else
- return LIUVacuumEnvironment.ACTION_MOVE_FORWARD;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement