You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Party.py 917B

4 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. from library import turn_around, turn_right, move_to_wall
  2. def clean_room():
  3. turn_left()
  4. while front_is_clear():
  5. turn_right()
  6. clean_row()
  7. move_to_next_row()
  8. turn_right()
  9. clean_row()
  10. def clean_row():
  11. while front_is_clear():
  12. clean_cell()
  13. move()
  14. clean_cell()
  15. turn_around()
  16. move_to_wall()
  17. turn_around()
  18. def clean_cell():
  19. if object_here():
  20. take()
  21. def move_to_next_row():
  22. turn_left()
  23. move()
  24. think(30)
  25. clean_room()
  26. ################################################################
  27. # WARNING: Do not change this comment.
  28. # Library Code is below.
  29. ################################################################
  30. def turn_right():
  31. for _ in range(3):
  32. turn_left()
  33. def turn_around():
  34. turn_left()
  35. turn_left()
  36. def move_to_wall():
  37. while front_is_clear():
  38. move()