ループとブラックジャックのシンプルなゲーム

user_point = 0 
computer_point = 0 
random_user = 0 
USER_NAME =入力( "を入力して下さいゲーマー名")
user_pointながら<= 21とcomputer_point <= 21:
    :user_point <= 21であれば
        random_user = random.choice(範囲(0,16) )
        場合random_user> = 11:
            user_point + = 0.5 
        他:
            user_point + = random_user 
    場合computer_point <= 21:
        random_computer = random.choice(範囲(0,16))
        であればrandom_computer> = 11:
            computer_point + = 0.5 
        他:
            computer_point + = random_computer 
プリント( "%s"は%computer_point)
プリント( "%s"は%のuser_point)
user_point> computer_point> 21またはuser_point場合== 21:
    印刷( "!プレイヤー勝つ")
のelifのuser_point == computer_point:
    プリント( "平和")
他:
    プリント( "コンピュータの勝利")

  

おすすめ

転載: www.cnblogs.com/lcc1234/p/11248624.html