Commit 7e1d8f1f by BellCodeEditor

save project

parent b5c6bbbe
Showing with 62 additions and 0 deletions
import turtle
#背景
screen=turtle.Screen()
screen.bgcolor("red")
#写字笔
pen=turtle.Pen()
pen.penup()
pen.goto(100,80)
pen.write("诺依,你好!\n我会用python编辑器了,\n很好用哦",font=("times",20,"normal"))
pen.hideturtle()
#画心笔
pen1=turtle.Pen()
pen1.pensize(5)
pen1.pencolor("red")
#爱心的大小
pen1.penup()
len=60
pen1.goto(-10,100)
pen1.pendown()
pen1.left(45)
pen1.forward(2*len)
pen1.circle(len,180)
pen1.right(90)
pen1.circle(len,180)
pen1.forward(2*len)
pen1.hideturtle()
turtle.done()
if player==computer:
print("平局")
elif player=="石头"and computer=="剪刀":
print("恭喜,你赢了")
elif player=="剪刀"and computer=="布"
print("恭喜,你赢了)
elif player==""and computer=="石头":
print("恭喜你,你赢了")
else:
print("很遗憾,你输了")
\ No newline at end of file
# 玩家出拳
# 玩家出拳
player=input("请出拳(剪刀/石头/布):")
print("玩家出拳:"+player)
#计算机出拳
input(radom)
list=["石头","剪刀","布"]
computer=random.choice(list)
print("计算机出拳:"+computer)
#显示结果
if player==computer:
print("平局")
elif player=="剪刀" and computer=="布":
print("恭喜,你赢了")
elif player=="石头" and computer=="剪刀":
print("恭喜,你赢了")
elif player=="布" and computer=="石头":
print("恭喜,你赢了")
else:
print("很遗憾,你输了")
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