石头剪子布
石头剪子布,是一种猜拳游戏。起源于中国,然后传到日本、朝鲜等地,随着亚欧贸易的不断发展它传到了欧洲,到了近现代逐渐风靡世界。简单明了的规则,使得石头剪子布没有任何规则漏洞可钻,单次玩法比拼运气,多回合玩法比拼心理博弈,使得石头剪子布这个古老的游戏同时用于“意外”与“技术”两种特性,深受世界人民喜爱。
游戏规则:石头打剪刀,布包石头,剪刀剪布。
现在,需要你写一个程序来判断石头剪子布游戏的结果。
#石头剪刀布.py
N = input("请输入数:")
T = int(N)
from random import*
num = 0
for i in range(T):
M = choice(["Rock","Scissors","Paper"])
P = choice(["Rock","Scissors","Paper"])
if (M,P) == ("Rock","Scissors") or (M,P) == ("Scissors","Paper") or (M,P) == ("Paper","Rock") :
print(M,P,"Player1")
elif (M,P) == ("Rock","Rock") or (M,P)== ("Scissors","Scissors") or (M,P)== ("Paper","Paper"):
print(M,P,"Tie")
else:
print(M,P,"Player2")