Commit 03348f60 by BellCodeEditor

auto save

parent 8b6151a1
Showing with 30 additions and 23 deletions
import random import turtle
# 玩家出拳 p=turtle.Pen()
sjb=input("请出拳")
print("玩家出拳:"+sjb)
#电脑出拳
list=["石头","剪刀","布"]
dn=random.choice(list)
print("电脑出拳:"+dn)
if sjb in list:
print("输入正确")
if sjb==dn:
print("平局")
elif sjb=="石头" and dn=="剪刀":
print("赢了")
elif sjb=="剪刀" and dn=="布":
print("赢了")
elif sjb=="布" and dn=="石头":
print("赢了")
else:
print("输了")
else:
print("输入有误:请重新输入!")
\ No newline at end of file
#导入turtle
import turtle
#创建画笔
p=turtle.Pen()
#写入文字
screen=turtle.Screen()
screen.bgcolor("light blue")
p.write("jijiyyy",font=("Times",30,"normal"))
p.hideturtle()
p1=turtle.Pen()
p1.shape("turtle")
p1.penup()
p1.goto(-100,100)
p1.pensize(5)
p1.pencolor("red")
len=30
p1.pendown()
p1.left(45)
p1.forward(2*len)
p1.circle(len,180)
p1.right(90)
p1.circle(len,180)
p1.forward(2*len)
p1.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