Commit 18517a02 by BellCodeEditor

save project

parent 8924cdee
Showing with 20 additions and 15 deletions
import random import turtle
player=input("请出拳(石头/剪刀/布") pen=turtle.Pen()
print("玩家出拳",player) pen.penup()
i=["石头","剪刀","布"] pen.goto(0,-100)
if player in i: pen.pendown()
computer=random.choice(i) pen.write("efewffwe",font=("Time",30,"normal"))
print("电脑出拳",computer) pen.hideturtle()
if player==computer: pen2=turtle.Pen()
ptint("平局") pen2.pencolor('red')
elif (player=="石头" and computer=="剪刀") or (player=="剪刀" and computer=="布") or (player=="布" and computer=="石头"): pen2.fillcolor("red")
print("赢") pen2.begin_fill()
else: pen2.left(45)
print("失败") pen2.forward(100)
else: pen2.circle(50,180)
print("输入错误") pen2.right(90)
pen2.circle(50,180)
pen2.forward(100)
pen2.end_fill()
pen2.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