Advertisement
dougbaker45

craps

Jul 23rd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. import random
  2. players = {}
  3. def inputplayers():
  4.     playername = None
  5.     while playername != '':
  6.         playername = str(input('Player Name? : '))
  7.         if playername != '':
  8.             players[playername] = 500
  9. def potcheck():
  10.     global pots
  11.     for player in players:
  12.         print('Current Pot for', player, ':',  players[player])
  13.     pots = sum(players.values())
  14. def roll():
  15.     global dice1, dice2
  16.     dice1 = random.randint(1, 6)
  17.     dice2 = random.randint(1, 6)
  18.     print(dice1, dice2)
  19.  
  20. #def openingroll():
  21.  
  22. def game():
  23.     print ('Welcome to Craps!\nPress enter when done!')
  24.     state = 'off'
  25.     inputplayers()
  26.     potcheck()
  27.     if pots > 0:
  28.         print('game on')
  29.         roll()
  30.    
  31.  
  32.  
  33. game()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement