parent
3ef372196c
commit
e67e21e955
|
@ -85,17 +85,17 @@
|
|||
print('你的总资产为:', money)
|
||||
needs_go_on = False
|
||||
while True:
|
||||
debt = int(input('请下注: '))
|
||||
if 0 < debt <= money:
|
||||
bet = int(input('请下注: '))
|
||||
if 0 < bet <= money:
|
||||
break
|
||||
first = randint(1, 6) + randint(1, 6)
|
||||
print('玩家摇出了%d点' % first)
|
||||
if first == 7 or first == 11:
|
||||
print('玩家胜!')
|
||||
money += debt
|
||||
money += bet
|
||||
elif first == 2 or first == 3 or first == 12:
|
||||
print('庄家胜!')
|
||||
money -= debt
|
||||
money -= bet
|
||||
else:
|
||||
needs_go_on = True
|
||||
while needs_go_on:
|
||||
|
@ -104,10 +104,10 @@
|
|||
print('玩家摇出了%d点' % current)
|
||||
if current == 7:
|
||||
print('庄家胜')
|
||||
money -= debt
|
||||
money -= bet
|
||||
elif current == first:
|
||||
print('玩家胜')
|
||||
money += debt
|
||||
money += bet
|
||||
else:
|
||||
needs_go_on = True
|
||||
print('你破产了, 游戏结束!')
|
||||
|
|
Loading…
Reference in New Issue