Commit 235b7390 by BellCodeEditor

auto save

parent fad61626
Showing with 18 additions and 15 deletions
import turtle
pen=pen.turtle()
import random import random
list=["剪刀","石头","布"] list=["剪刀","石头","布"]
player=input("请出拳:") while True:
print("玩家出拳:"+player) player=random.choice(list)
computer=random.choice(list) print("玩家出拳:"+player,end=" ")
print("电脑出拳:"+computer) computer=random.choice(list)
if player==computer: print("电脑出拳:"+computer,end=" ")
print("平局") if player==computer:
elif player=="剪刀" and computer=="布": print("平局",end=" ")
print("你赢了") elif player=="剪刀" and computer=="布":
elif player=="石头" and computer=="剪刀": print("你赢了",end=" ")
print("你赢了") elif player=="石头" and computer=="剪刀":
elif player=="布" and computer=="石头": print("你赢了",end=" ")
print("你赢了") elif player=="布" and computer=="石头":
else: print("你赢了",end=" ")
print("你输了") else:
\ No newline at end of file print("你输了",end=" ")
\ 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