Commit 3b25ec2c by BellCodeEditor

auto save

parent 26b3b1d4
Showing with 47 additions and 0 deletions
_111_=0
_qq_=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]
_kx_=0#玩家
_WW_=0#庄家
_kx1_=0#玩家现拥有点数
_ww1_=0#庄家现有有点数
import random
print("欢迎来到21点!")
_kx_=random.choice(_qq_)
print("以随机为你获取点数:"+str(_kx_))
#kx_=int(_kx_)
print("您现在拥有点数:"+str(_kx_+_kx1_))
_ww_=random.choice(_qq_)
print("庄家现拥有点数:"+str(_ww_+_ww1_))
_111_=input("是否继续?(按0继续,任意键结束)")
while True:
if _kx1_<=21 and _ww1_<=21:
if _111_=="0":
_kx_=random.choice(_qq_)
print("以随机为你获取点数:"+ str(_kx_))
print("您现在拥有点数:"+str(_kx_+_kx1_))
_kx1_=_kx_+
_ww_=random.choice(_qq_)
print("庄家现拥有点数:"+str(_ww_+_ww1_))
_111_=input("是否继续?(按0继续,任意键结束)")
else:
if _kx1_==_ww1_:
print("平局")
break
elif _ww1_>_kx1_:
print("你输了")
break
else :
print("你赢了")
break
else:
if _kx1_>21 and _ww1_<=21:
print("你输了")
break
if _ww1_>21 and _kx1_<=21:
print("你赢了")
break
if _kx1_>21 and _ww1_>21:
print("平局")
break
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment