Advertisement
cat

Untitled

cat
Sep 15th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. import random
  2. from time import sleep
  3. wins = 0
  4. losses = 0
  5.  
  6.  
  7.  
  8. def game_roll():
  9.     global wins
  10.     global losses
  11. while wins != 3 and losses != 3:
  12.     print("If I roll 55 or below, you win.  Good luck!")
  13.     sleep(1)
  14.     print("Rolling!...")
  15.     sleep(2)
  16.     number = random.randint(55, 100)
  17.     print(number)
  18.     if number >= 56:
  19.      print("That sucks! 1 point to the host.")
  20.      losses = losses + 1
  21.     else:
  22.      print("you won this ground!")
  23.      wins = wins + 1
  24.      game_roll()
  25.  
  26.  
  27. def invalid_entry():
  28.  if game_start == "N":
  29.     print("Please type Y once you're ready to play")
  30.  elif game_start != "N":
  31.     print("Please enter a valid character")
  32.  
  33. game_start = input("Would you like to play a game of dice?  First to 3 wins: Y/N?: ").upper()
  34. if game_start == "Y":
  35.   game_roll()
  36. else:
  37.   invalid_entry()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement