Commit 31657393 by BellCodeEditor

auto save

parent 94c28a9a
Showing with 30 additions and 27 deletions
# 玩家出拳
import random
print('开始游戏!')
c = random.randint(1,3)
#石头:1 剪刀:2 布:3
p = input('请出拳:')
print('玩家出拳:' + p)
if p == '石头' :
if c == '1':
print('本轮结果:平局')
if c == '2':
print('本轮结果:玩家获胜!')
if c == '3':
print('本轮结果:电脑获胜!')
if p == '剪刀' :
if c == '1':
print('本轮结果:电脑获胜!')
if c == '2':
print('本轮结果:平局')
if c == '3':
print('本轮结果:玩家获胜!')
if p == '布' :
if c == '1':
print('本轮结果:玩家获胜!')
if c == '2':
print('本轮结果:电脑获胜!')
if c == '3':
print('本轮结果:平局')
while True:
import random
print('----------开始游戏!----------')
c = random.randint(1,3)
#石头:1 剪刀:2 布:3
p = input('请出拳:')
print('玩家出拳:' + p)
print(c)
if p == '石头' :
if c == 1:
print('本轮结果:平局')
if c == 2:
print('本轮结果:玩家获胜!')
if c == 3:
print('本轮结果:电脑获胜!')
if p == '剪刀' :
if c == 1:
print('本轮结果:电脑获胜!')
if c == 2:
print('本轮结果:平局')
if c == 3:
print('本轮结果:玩家获胜!')
if p == '布' :
if c == 1:
print('本轮结果:玩家获胜!')
if c == 2:
print('本轮结果:电脑获胜!')
if c == 3:
print('本轮结果:平局')
print('----------结束游戏!----------')
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