"""
石头1 布2 剪刀3
赢
我们 电脑 结果
1 3 -2
2 1 1
3 2 1
"""import random
# 我们出拳
a =int(input('''请出拳
石头是1,布是2,剪刀是3'''))# 电脑出拳
b = random.randint(1,3)# 判断胜负if a==1or a==2or a==3:
result = a - b
if result ==-2or result ==1:print('胜利')elif result ==0:print('平局')else:print('失败')if a==1:print('玩家:石头')elif a==2:print('玩家:布')else:print('玩家:剪刀')if b==1:print('电脑:石头')elif b==2:print('电脑:布')else:print('电脑:剪刀')else:print('请认真游戏')
import random
import turtle as t
size_x =5
size_big =20
t.speed(0)# rgb
t.colormode(255)
color =(random.randint(0,255),random.randint(0,255),random.randint(0,255))
t.color(color,color)
t.bgcolor('black')
t.begin_fill()
a= random.randint(size_x ,size_big)
b=144
t.fd(a)
t.lt(b)
t.fd(a)
t.lt(b)
t.fd(a)
t.lt(b)
t.fd(a)
t.lt(b)
t.fd(a)
t.lt(b)
t.end_fill()
t.up()
t.goto(random.randint(0,500),random.randint(0,500))
t.down()