Commit 16f7b04a by BellCodeEditor

save project

parent f220d0d0
Showing with 12 additions and 2 deletions
...@@ -3,4 +3,14 @@ piayer = input("请出拳(石头、剪刀、布):") ...@@ -3,4 +3,14 @@ piayer = input("请出拳(石头、剪刀、布):")
print("玩家出拳:"+piayer) print("玩家出拳:"+piayer)
lits=["石头","剪刀","布"] lits=["石头","剪刀","布"]
NPC=random.choice(lits) NPC=random.choice(lits)
print("计算机出拳:"+NPC) print("计算机出拳:"+NPC)
\ No newline at end of file if piayer==NPC:
print("平局")
elif piayer=="石头"and NPC=="剪刀":
print("玩家获胜")
elif piayer=="剪刀"and NPC=="布":
print("玩家获胜")
elif piayer=="布"and NPC=="石头":
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