Commit a7fd5026 by BellCodeEditor

auto save

parent 5301f39e
Showing with 8 additions and 0 deletions
#玩家出拳 #玩家出拳
a=input("玩家请出拳(石头/剪刀/布):") a=input("玩家请出拳(石头/剪刀/布):")
print("玩家出"+a) print("玩家出"+a)
#电脑出拳 #电脑出拳
...@@ -6,3 +7,9 @@ import random ...@@ -6,3 +7,9 @@ import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
computer=random.choice(list) computer=random.choice(list)
print("电脑出:"+computer) print("电脑出:"+computer)
if computer==a:
print("平局")
elif (computer=="石头" and a=="布") or (computer=="剪刀" and a=="石头") or (computer=="布" and a=="剪刀"):
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