Commit aaa59aac by BellCodeEditor

save project

parent ef53b59e
Showing with 23 additions and 16 deletions
player=input("请出拳(石头/剪刀/布):")# 玩家出拳 import turtle
print("玩家出拳:"+player) pen=turtle.Pen()
import random pen.penup()
list=["石头","剪刀","布"] pen.goto(100,-100)
computer=random.choice(list) pen.write("你好",font=("times",18,"normal"))
print("计算机出拳:"+computer) pen.hideturtle()
if player in list: len=60
if player==computer: pen1=turtle.Pen()
print("平局") pen1.pencolor("red")
elif (player=="石头" and computer=="剪刀")or(player=="剪刀" and computer=="布")or(player=="布" and computer=="石头"): pen1.pensize(5)
print("恭喜你,胜利了") pen1.fillcolor("red")
else: pen1.begin_fill()
print("很遗憾,你输了") pen1.left(45)
else: pen1.forward(len*2)
print("输入错误") pen1.circle(len,180)
\ No newline at end of file pen1.right(90)
pen1.circle(len,180)
pen1.forward(len*2)
pen1.end_fill()
pen1.hideturtle()
screen=turtle.Screen()
screen.bgcolor("pink")
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