Commit 450ef9a2 by BellCodeEditor

auto save

parent 220fe62b
Showing with 43 additions and 0 deletions
import turtle*
pencolor(red)
fillcolor(blue)
begin_fill
for i in range(5):
forward(100)
left(144)
end_fill()
\ No newline at end of file
# 玩家出拳
import random
c=['布','剪刀','石头']
computer=random.choice(c)
a=input('请输入:')
print('player:'+a)
print('computer:'+computer)
if a in c:
if a==computer:
print('平局')
if a=='剪刀' and computer=='布' or a=='布' and computer=='石头' or a=='石头' and computer=='剪刀':
print('你赢了')
if a=='布' and computer=='剪刀' or a=='石头' and computer=='布' or a=='剪刀' and computer=='石头':
print('你输了')
else:
print('输入错误')
\ No newline at end of file
# 玩家出拳
import random
a=input('请输入:')
c1=['布','剪刀','石头']
computer=(random.choice(c1)
print('player:',a)
print('computer:',computer)
if a in c1:
if a==computer:
print('平局')
elif (a=='布' and computer=='石头') or (a=='石头' and computer=='剪刀') or (a=='布' and computer=='石头'):
print('你赢了')
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