Commit 81a3f0ef by BellCodeEditor

save project

parent adc27c64
Showing with 12 additions and 2 deletions
...@@ -15,4 +15,14 @@ turtle.done() ...@@ -15,4 +15,14 @@ turtle.done()
p=input("请出拳,石头剪刀布") p=input("请出拳,石头剪刀布")
print("玩家出,"+p) print("玩家出,"+p)
\ No newline at end of file import random
s=["石头,剪刀,布"]
s=random.choice(s)
print("电脑出的是,"+s)
if s==p:
print("平局")
elif (p=="布" and s=="石头") or (p=="剪刀" and s=="布") or (p=="石头" and s=="剪刀")
print("玩家赢")
elif (s=="布" and p=="石头") or (s=="剪刀" and p=="布") or (s=="石头" and p=="剪刀") :
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