Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. import sys import exit
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. def startPlay(): #Code for asking to play the game
  13. play=""
  14. playCheck=""
  15. while play not in ["Y", "N"]: #Y represents Yes and N represents No
  16. play = input ("Do you want to play (Y or N)? ").upper()
  17. while playCheck not in ["Y","N"]: #Giving an option of Yes or No
  18. playCheck = input("Do you want to play (Y or N)? ").upper()
  19. if playCheck != play:
  20. print("Your answers do not match, re-enter") #Code for asking for re-entering the answer as the answer submitted is not an option
  21. playCheck()
  22. if play=="Y":
  23. print("A strange tingle trickles across your skin. You feel lightheaded and sit down. Feeling better you stand up again and notice your reflection in a window.")
  24. print("\033[0;37;46mYou notice that your Game Changer (Jewel) is missing\033[0m")
  25. nameInput()
  26. else:
  27. print ("The only way to win the game is to not play it")
  28. quit() #This quits the code
  29.  
  30.  
  31. def nameInput (): #This makes a function called “nameInput” which asks for proper name and verification
  32. global name
  33. name = "" #sets name as none
  34. nameCheck = "" #This sets the variable “nameCheck” as none.
  35. while name == "" or len(name) > 25 or not name.isalpha(): #This code sets username character limit to 25
  36. name = input("Enter your name: ").capitalize() #Setting the variable 'name'a value.
  37. while nameCheck == "" or len(nameCheck) > 25 or not nameCheck.isalpha(): # This checks for username to be less than 25
  38. nameCheck = input("Enter name again to verify: ").capitalize() #Giving a value in nameCheck. Actually used for doublechecking the 'name' value
  39. if nameCheck != name:
  40. nameInput ()
  41. else:
  42. roadChoice()
  43.  
  44. life = 1
  45.  
  46. def grab ():
  47. if inventory == "" and invenObject == "" :
  48. print ("You can't grab that!")
  49. elif inventory == "" and invenObject == "sword" or "map" or "costume" or "pots of healing" or "hello shield" or "game changer":
  50. inventory = inventory + invenObject
  51. elif inventory != "":
  52. inventory = inventory + " and " + invenObject
  53. else:
  54. print ""
  55.  
  56. def room1 ():
  57. map
  58.  
  59. startPlay()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement