Commit a572f9a9 by BellCodeEditor

save project

parent 25116b4c
Showing with 18 additions and 18 deletions
# 玩家出拳 import turtle
player = input("请出拳(石头/剪刀/布):") screen=turtule.Screen()
print("玩家出拳:"+player) screen.bgcolor("light blue")
# 计算机随机出拳 pen=turtle.Pen()
import random pen.penup()
list = ["石头","剪刀", "布"] pen.goto(100,-100)
computer = random.choice(list)
print("计算机出拳:"+computer) color=input("你想要什么颜色?")
# 显示结果
if player == computer: pen.fillcolor(color)
print("平局") pen.begin_fill()
elif (player=="石头" and computer=="剪刀")or(player=="剪刀" and computer=="布")or(player=="布" and computer=="石头"): for i in range(5):
print("恭喜,你赢了") pen.forward(200)
else: pen.right(144)
print("很遗憾,你输了") pen.end_fill()
else: pen.hideturtle()
print("输入错误") turtle.done()
\ No newline at end of file \ 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