Commit 717e4426 by BellCodeEditor

save project

parent 07dfcb0a
Showing with 23 additions and 20 deletions
# 玩家出拳 import turtle
player=input("石头,剪刀或布")
print("玩家出拳:"+player)
import random import random
list=("石头","剪刀","布") len=random.randint(10,50)
letter=random.choice(list) pen=turtle.Pen()
print("电脑出拳:"+letter) screen=turtle.Screen()
if player in list: screen.bgcolor("light blue")
if player==letter: pen.speed(100)
print("平局") pen.penup()
elif player=="石头" and letter=="剪刀": pen.goto(150,-100)
print("玩家赢") pen.write("sb",font=("Times",30,"normal"))
elif player=="剪刀" and letter=="布": pen.color("red")
print("玩家赢") pen.goto(50,0)
elif player=="布" and letter=="石头": pen.pendown()
print("玩家赢") pen.left(90)
else: pen.circle(len,180)
print("电脑赢") pen.right(180)
else: pen.circle(len,180)
print("sb") pen.left(35)
\ No newline at end of file pen.forward(len*2)
pen.left(112)
pen.forward(len*2)
pen.hideturtle()
turtle.done()
\ 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