Commit 7e892b1b by BellCodeEditor

save project

parent 731c96bb
Showing with 19 additions and 6 deletions
#palyer = input("同志出哪个?剪刀,石头还是布:")
#print("玩家出拳" + palyer)
#这是一个人机版的剪刀石头布游戏,玩家会和人机进行比赛。
#玩家出拳完毕
#人机开始出拳
import random
guess_list = ["rook","sessior","papper"]
print("机器人出了" + guess_list)
\ No newline at end of file
player = input("同志出哪个?剪刀,石头还是布:")
print("玩家出拳" + player)
guess_list = ["石头","剪刀","布"]
#人机随机选择
computer = random.choice(guess_list)
print("人机出拳:" + computer)
if player == computer:
print("平局")
elif(player == "石头" and computer =="剪刀") or (player =="剪刀" and computer == "布") or (player =="布" and computer == "石头"):
print("赢了")
else:
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