# -*- coding: utf-8 -*-
"""
Created on Fri Oct 25 16:28:12 2019
if判斷綜合演練,剪刀石頭布
@author: fei
"""
import random
# 要使用隨機數,需要導入隨機數的模塊random,--工具包
# 提示玩家出拳
player = int(input("請輸入要出的拳:石頭-1,剪刀-2,布-3"))
# randint(a, b)包含a和b,要求a<b
# 電腦隨機出拳
computer = random.randint(1, 3)
print("玩家選擇的拳頭是:", player, ";電腦選擇的拳頭是:", computer)
# 比較勝負,石頭勝剪刀,剪刀勝布,布勝石頭
# 玩家勝利
if((player == 1 and computer == 2)
or (player == 2 and computer == 3)
or (player == 3 and computer == 1)):
print("O yeah,電腦弱爆了!")
# 平局
elif player == computer:
print("平局")
# 電腦勝利
else:
print("電腦勝利,玩家失敗!!!")