Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. """Simulation."""
  2.  
  3.  
  4. def simulate(wmap: list, moves: list) -> list:
  5. """
  6. Simulate a robotic lawn mower.
  7.  
  8. :param wmap: A list of strings indicating rows that make up the map.
  9. The map is always rectangular and the minimum given size is 1x1.
  10. Cut grass is indicated by the symbol ('-'), low grass by ('w') and high grass by ('W').
  11. The robot position is indicated by the symbol ('X'). There is always one robot on the map.
  12. Obstacles are indicated by the symbol ('#').
  13.  
  14. :param moves: A list of moves.
  15. The moves are abbreviated N - north, E - east, S - south, W - west.
  16. Ignore moves that would put the robot out of bounds or crash it into an obstacle.
  17.  
  18. :return: A list of strings indicating rows that make up the map. Same format as the given wmap.
  19.  
  20. Grass under Sparky's starting position is always cut grass ('-').
  21. If Sparky mows high grass, it first turns into low grass ('w') and then from low grass into cut grass ('-').
  22. """
  23. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement