Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- direction = ("")
- last_dir = ("")
- def battle():
- print("battle begins")
- while direction.upper() != ("S"):
- direction = input("Which way? ")
- if direction.upper() == ("N") and last_dir.upper() != ("N") and last_dir.upper() != ("E") and last_dir.upper() != ("W"):
- print("You go North and come back")
- last_dir = direction
- elif direction.upper() == ("E") and last_dir.upper() != ("E"):
- print("You go East and come back")
- last_dir = direction
- elif direction.upper() == ("W") and last_dir.upper() != ("W"):
- print("You go West and come back")
- last_dir = direction
- elif direction.upper() == ("S"):
- battle()
- else:
- print("You already went that way! You stay put.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement