Advertisement
007egleagent

Pig Game

Dec 12th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import math
  2. import random
  3. import sys
  4.  
  5. def rolldice():
  6.     return random.randint(1, 6)
  7.  
  8. turn_score = 0
  9.  
  10. while turn_score < 100:
  11.     dice = rolldice()
  12.     turn_score += dice
  13.     print(f'Rolled a {dice}')
  14.     if dice==1:
  15.         print('Pigged Out!')
  16.         break
  17.     else:
  18.         continue
  19.        
  20. e=+turn_score
  21.  
  22. print('Player Ones score:', g)
  23. print('Player Twos score:', k)
  24.  
  25. print(f'Turn score = {turn_score}')
  26. print('New total score =', e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement