Advertisement
Guest User

Untitled

a guest
Nov 12th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. x = 0
  2. y = 0
  3. quitCommand = 0
  4.  
  5. print "Welcome to the World of Textcraft!"
  6. print "----------------------------------"
  7. print ""
  8.  
  9. while quitCommand != int(5):
  10. print "You are currently at (" + str(x) + ", " + str(y) + ")"
  11. print "Enter a command (1 = North, 2 = East, 3 = South, 4 = West, 5 = Exit):"
  12. if int(raw_input()) == 1:
  13. print "Moving north"
  14. y = y + 1
  15. elif int(raw_input()) == 2:
  16. print "Moving east"
  17. x = x + 1
  18. elif int(raw_input()) == 3:
  19. print "Moving south"
  20. y = y - 1
  21. elif int(raw_input()) == 4:
  22. print "Moving west"
  23. x = x - 1
  24. elif int(raw_input()) == 5:
  25. print "Dost thou leave so soon? Fare thee well!"
  26. quitCommand = 5
  27. else:
  28. print "I find your lack of reading comprehension skills disturbing."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement