Commit 8da42708 by BellCodeEditor

save project

parent 52e458fc
Showing with 24 additions and 20 deletions
import random import turtle
p=input("请出拳:石头/剪刀/布")# 玩家出拳 #背景颜色
print("玩家出拳:"+p) screen=turtle.Screen()
jack=["石头","剪刀","布"] screen.bgcolor("light blue")
c=random.choice(jack) #写字
print("计算机出拳:"+c) pen=turtle.Pen()
if p in jack: pen.penup()
if p==c: pen.goto(100,-100)
print("平局") pen.write("Hi,诺依~\n用python写电子贺卡真是太有趣啦~\n我也喜欢python~\n——悟空 ",font=("Times",20,"normal"))
elif p=="剪刀" and c=="布": pen.hideturtle()
print("恭喜你,你赢了") #画爱心
elif p=="石头" and c=="剪刀": len = 60
print("恭喜你,你赢了") pen1=turtle.Pen()
elif p=="布" and c=="石头": pen1.pencolor("red")
print("恭喜你,你赢了") pen1.pensize(5)
else: pen1.left(45)
print("很遗憾,你输了") pen1.forward(len*2)
else: pen1.circle(len,180)
print("输入错误") pen1.right(90)
\ No newline at end of file pen1.circle(len, 180)
pen1.forward(len*2)
pen1.hideturtle()
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