Commit d3ad01dc by BellCodeEditor

save project

parent 39f46b29
Showing with 17 additions and 17 deletions
player = input("请出拳(石头/剪刀/布):") import turtle
print("玩家出拳:" + player)
import random Pen=turtle.Pen()
list = ["石头", "剪刀", "布"] Pen.write("SB!",
computer = random.choice(list) font=("Times",30,"normal"))
print("电脑出:" + computer) pen1=turtle.Pen()
if player in list: pen1.pensize(5)
if player==computer: pen1.pencolor("red")
print("平局") pen1.left(45)
elif (player == "石头" and computer == "剪刀") or (player == "剪刀" and computer == "布") or ( pen1.forward(100)
player == "布" and computer == "石头"): pen1.circle(50,180)
print("恭喜,你赢了") pen1.right(90)
else: pen1.circle(50,180)
print("很遗憾,你输了") pen1.forward(100)
else: pen1.hideturtle()
print("输入错误") turtle.done()
\ No newline at end of file \ 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