Advertisement
JZQR

Game 1.1 in Python

Jan 23rd, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. #By JZQR
  2. import random
  3.  
  4. def rnd():
  5.     s = random.randint(1, 6)
  6.     return s
  7. z = 0
  8. x =1
  9. print("Rules: ")
  10. print("1. You start with 1 point.")
  11. print("2. If Rolled number = 1, Yours point = 0, and the game ends.")
  12. print("3. If Rolled number = 2 or 3 or 4, Yours point = point * 2, and the game ends.")
  13. print("4. If Rolled number = 5 or 6, Yours point = point * 2, and You can Rolled number again.")
  14. print("-------------")
  15. print("Start Game")
  16. print("Points: 1")
  17. print("-------------")
  18. y = 6
  19. while y == 5 or y == 6:
  20.     y = rnd()
  21.     z += 1
  22.     if y == 1:
  23.         x = 0
  24.         print("Rolled number: ", y)
  25.         print("Points: ", x)
  26.         print("Round ", z)
  27.         print("-------------")
  28.     if y == 2 or y == 3 or y == 4:
  29.         x = x*2
  30.         print("Rolled number: ", y)
  31.         print("Points: ", x)
  32.         print("Round ", z)
  33.         print("-------------")
  34.     if y == 5 or y == 6:
  35.         x= x*2
  36.         print("Rolled number: ", y)
  37.         print("Points: ", x)
  38.         print("Round ", z)
  39.         print("-------------")
  40.  
  41. print('End Game')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement