python猜拳游戏

import random
sum = 10000
while True:
    print("******4399>>>猜拳游戏*8.0版本******")
    print("游戏规则:设石头(0),剪刀(1),布(2)")
    print("开始游戏-----5")
    print("退出游戏-----6")
    shezhi = int(input("请输入 5 或 6 :"))
    if shezhi == 5 or shezhi == 6:
        while (shezhi == 5):
            num = int(input("您现在的积分为:%s\n请选择你的积分倍率(随意数字):" % sum))
            while num > 0:
                print("*******!!!游戏开始!!!*******", "  积分倍率:%s" % num, "   你的积分为:%s" % sum)
                wo = int(input("请输入 石头(0),剪刀(1),布(2):"))
                diannao = random.randint(0, 2)
                if wo == 0 or wo == 1 or wo == 2:
                    print("你输入的是:", wo)
                    print("电脑选择的是:", diannao)
                    if ((diannao == 0 and wo == 1) or (diannao == 1 and wo == 2) or (diannao == 2 and wo == 0)):
                        sum -= 1 * num;
                        print("电脑把你打败了!!!")
                    elif ((diannao == 1 and wo == 0) or (diannao == 2 and wo == 1) or (diannao == 0 and wo == 2)):
                        sum += 1 * num;
                        print("你把电脑打败了!!!")
                    else:
                        print("你们打平了!!!")
                    print("************游戏结束************")
                else:
                    print("请输入正确数字!!!")
                print(" ")
            print("不能输入负数请重新输入!!!")
        print("************游戏结束************")
        print(" ")
    else:
        print("请输入正确数字!!!")
    print(" ")

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小航冲冲冲

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值