Commit a0874faa by BellCodeEditor

save project

parent 9a235319
Showing with 13 additions and 19 deletions
player=input("请玩家出拳(石头/剪刀/布):") import turtle
print("玩家出拳:"+player) pen1=turtle.Pen()
pen1.pencolor("red")
import random pen1.pensize(5)
list=["石头","剪刀","布"] pen1.left(45)
computer=random.choice(list) pen1.forward(100)
print("计算机出拳:"+computer) pen1.circle(50,180)
pen1.right(90)
if player==computer: pen1.circle(50,180)
print("平局") pen1.forward(100)
elif player=="石头" and computer=="剪刀": pen1.hideturtle()
print("恭喜你赢了") turtle.done()
elif player=="剪刀" and computer=="布": \ No newline at end of file
print("恭喜你赢了")
elif player=="布" and computer=="石头":
print("恭喜你赢了")
else:
print("你输了")
\ No newline at end of file
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