Commit f4aae31d by BellCodeEditor

auto save

parent b711434d
Showing with 12 additions and 16 deletions
# 玩家出拳 import turtle
player = input("请出拳(石头/剪刀/布):") pen = turtle.Pen()
print("玩家出拳:"+player) color=input("你想要什么颜色的五角星呀?")
# 计算机随机出拳 pen.fillcolor(color)
import random #绘制五角星#
list = ["石头","剪刀", "布"] pen.begin_fill()
computer = random.choice(list) for i in range(5): #重复执行5次
print("计算机出拳:"+computer) pen.forward(200) #向前移动200步
# 显示结果 pen.right(144) #向右移动144度,注意这里的参数一定不能变
if player == computer: pen.end_fill() #结束填充红色
print("平局") turtle.done()
elif (player=="石头" and computer=="剪刀")or(player=="剪刀" and computer=="布")or(player=="布" and computer=="石头"): \ No newline at end of file
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