Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. import random
  2. user_choice = 0
  3. user_score = 0
  4. door_count = 5
  5. ghost_index = 0
  6. print("| Game - GHost game")
  7. print("||| There are N doors. Behind one there is a ghost.")
  8. print("||| Your task is not to get on the ghost for as long as possible")
  9. print("|| - The beginning of the game - ||")
  10. while True:
  11. for i in range(door_count):
  12.      print("___[" + str(i + 1) + "]", end = "")
  13. print("___")
  14. ghost_index = random.randint(1,door_count)
  15. user_choice = int(input("Door number"))
  16. for i in range(1,door_count + 1)
  17.   if i != ghost_index:
  18.     print("___[ ]", end = "")
  19.     else:
  20.       print("___[G]", end = "")
  21. print("")
  22. if user_choice == ghost_index:
  23.   print("")
  24.   print("-- Your lose! --")
  25.   break
  26. else:
  27.   user_score = user_score + 1
  28.   print("")
  29.   print("|| - New round - ||")
  30. print("||------------------||")
  31. print("You've earned - " + str(user_score) + "")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement