0
点赞
收藏
分享

微信扫一扫

Python猜拳小游戏

#猜拳小游戏

#0:石头;1:剪刀;2:布

#账户:yujinhua

#密码:123456

import random #随机数

computer=random.randint(0,2)

account=str(input("请输入游戏账户:"))

password=int(input("请输入游戏密码:"))

if account==("yujinhua") and password==123456:

   print("对局开始")

   circulate=1

   while circulate<=10:

       people=int(input("请出拳:【0:石头;1:剪刀;2:布】"))

       if people==0 and computer==1:

           print("你赢了!")

           pass

       elif people==1 and computer==2:

           print("你赢了!")

           pass

       elif people==2 and computer==0:

           print("你赢了!")

           pass

       elif people==computer:

           print("平局!")

           pass

       else:

           print("你输了!")

           pass

       print("对局结束")

       circulate+=1

else:

    print("账户或密码错误,请重试!")

举报

相关推荐

0 条评论