Commit 2d935255 by BellCodeEditor

save project

parent a13f5bbc
Showing with 31 additions and 27 deletions
import turtle import turtle
pen = turtle.Pen() # pen = turtle.Pen()
pen.write("锄禾日当午,\n汗滴禾下土。",font=("Times",30,"normal")) # pen.write("锄禾日当午,\n汗滴禾下土。",font=("Times",30,"normal"))
pen.hideturtle() # pen.hideturtle()
turtle.done # turtle.done()
\ No newline at end of file pen=turtle.Pen()
pen.shape("turtle")
pen.left(45)
forward(100)
pen.extent(50,180)
pen.right(90)
pen.extent(50,180)
forward(100)
turtle.done()
\ No newline at end of file
# import turtle
while True: # pen = turtle.Pen()
player = input("请出拳(石头/剪刀/布):") # pen.write("锄禾日当午,\n汗滴禾下土。",font=("Times",30,"normal"))
print("玩家出拳:"+player) # pen.hideturtle()
import random # turtle.done()
list = ["石头","剪刀","布"] pen1=turtle.Pen()
computer=random.choice(list) pen1.shape("turtle")
print("电脑出拳:"+computer) pen1.color("green")
if player in list: pen1.pensize(5)
if player == computer: pen1.left(45)
input("平局") pen1.forward(100)
elif (player=="石头") and (computer == "剪刀"): pen1.circle(50,180)
input("赢了") pen1.right(90)
elif (player=="布") and (computer=="石头"): pen1.circle(50,180)
input("赢了") pen1.forward(100)
elif (player=="剪刀") and (computer=="布"): pen1.turtle.hide
input("赢了") turtle.done()
else:
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