Commit 9058b82e by BellCodeEditor

save project

parent af07e3d2
Showing with 21 additions and 17 deletions
player = input("请出拳(石头/剪刀/布):") import turtle
print("玩家出拳:" + player) screen=turtle.Screen()
import random screen.bgcolor("light blue")
list=["石头","剪刀","布"] pen=turtle.Pen()
computer=random.choice(list) pen.penup()
print(computer) pen.goto(100,-100)
if player==computer: pen.write("Hi,诺依~\n用python写电子贺卡真是太有趣了~\n我也喜欢python`\n",font=("Times",30,"normal"))
print("平局") pen1=turtle.Pen()
elif player=="石头"and computer=="剪刀": pen1.pensize(5)
print("恭喜,你赢了") pen1.pencolor("red")
elif player=="剪刀"and computer=="布": pen.fillcolor("red")
print("恭喜,你赢了") pen.begin_fill()
elif player=="布"and computer=="石头": pen1.left(45)
print("恭喜,你赢了") pen1.forward(100)
else: pen1.circle(50,180)
print("很遗憾,你输了") pen1.right(90)
\ No newline at end of file pen1.circle(50,180)
pen1.forward(100)
pen1.hideturtle()
pen.end_fill()
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