Commit 99601499 by BellCodeEditor

save project

parent c66a449e
Showing with 16 additions and 22 deletions
# 利用write()帮助悟空给诺依回信吧~ import random
import turtle a = input("请出拳(石头/剪刀/布):")
screen=turtle.Screen() print("玩家出拳:"+a)
screen.bgcolor("light blue") list = ["石头","剪刀","布"]
len=screen.textinput("100","100") b = random.choice(list)
len=int(len) print(b)
pen=turtle.Pen() if a in list:
pen.write("你好\nSB.",font=("Times",30,"normal")) if a==b:
pen.hideturtle() print("你赢了")
len=60 elif(a=="石头" and b=="剪刀")or(a=="剪刀" and b=="布")or(a=="布" and b=="石头"):
pen.penup() print("恭喜,你赢了")
pen.goto(100,100) else:
pen.pendown() print("很遗憾,你输了")
pen.pensize(5) else:
pen.pencolor("red") print("输入错误")
pen.left(45) \ No newline at end of file
pen.forward(2*len)
pen.circle(len,180)
pen.right(90)
pen.circle(len,180)
pen.forward(2*len)
turtle.done()
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