Advertisement
Guest User

Untitled

a guest
May 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. direction = ("")
  2. last_dir = ("")
  3.  
  4. def battle():
  5. print("battle begins")
  6.  
  7. while direction.upper() != ("S"):
  8. direction = input("Which way? ")
  9.  
  10. if direction.upper() == ("N") and last_dir.upper() != ("N") and last_dir.upper() != ("E") and last_dir.upper() != ("W"):
  11. print("You go North and come back")
  12. last_dir = direction
  13. elif direction.upper() == ("E") and last_dir.upper() != ("E"):
  14. print("You go East and come back")
  15. last_dir = direction
  16. elif direction.upper() == ("W") and last_dir.upper() != ("W"):
  17. print("You go West and come back")
  18. last_dir = direction
  19. elif direction.upper() == ("S"):
  20. battle()
  21. else:
  22. print("You already went that way! You stay put.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement