Python:
猜拳小游戏:
from CardsSystem import GuessTools
cishu=0
num=2
while True:
print("欢迎来到猜拳游戏界面,输入4可以获取游戏帮助~")
GuessTools.page()
your_select = input("请输入:【1】石头\t\t【2】剪刀\t\t【3】布")
GuessTools.page()
if your_select=="1":
cishu += 1
GuessTools.judge(your_select,num)
elif your_select=="2":
cishu += 1
GuessTools.judge(your_select,num)
elif your_select=="3":
cishu += 1
GuessTools.judge(your_select,num)
elif your_select=="4":
cishu += 1
GuessTools.help()
elif your_select=="5":
cishu += 1
GuessTools.test_system_number()
elif your_select=="6":
cishu += 1
print("欢迎下次使用本游戏,您本次共进行了%i次操作,胜利%i次,下次继续加油哦~"%(cishu,num))
break
else:
print("您输入的信息有误,请查证后重试")
运行示例:
