Commit c81d2ea2 by BellCodeEditor

save project

parent 5e1af52f
Showing with 21 additions and 14 deletions
""" # 玩家出拳
请使用turtle模块画出五角星 player = input("请出拳(石头/剪刀/布):")
"""
import turtle print("玩家出拳:"+player)
pen = turtle.Pen() # 计算机随机出拳
pen.fillcolor("red") import random
pen.begin_fill() list = ["石头","剪刀", "布"]
for i in range(5): computer = random.choice(list)
turtle.left(144) print("计算机出拳:"+computer)
turtle.forward(200) # 显示结果
pen.end_fill() if player in list:
pen.hideturtle() print("输入正确")
turtle.done() if player == computer:
\ No newline at end of file print("平局")
elif (player=="石头" and computer=="剪刀")or(player=="剪刀" and computer=="布")or(player=="布" and computer=="石头"):
print("恭喜,你赢了")
else:
print("很遗憾,你输了")
else:
print("输入正确")
\ 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