python/조건문

가위바위보 업그레이드 (하나빼기)

june__Park 2021. 2. 16. 22:22
# 가위바위보 업그래이드 (하나빼기)

import random

comleft = random.randint(0, 2)
comright = random.randint(0, 2)

meleft = int(input("meleft ==> 0) 가위 , 1) 바위 , 2) 보"))
meright = int(input("meright ==> 0) 가위 , 1) 바위 , 2) 보"))

if comleft == 0:
    print("comleft ==> 가위")
elif comleft == 1:
    print("comleft ==> 바위")
elif comleft == 2:
    print("comleft ==> 보")

if comright == 0:
    print("comright ==> 가위")
elif comright == 1:
    print("comright ==> 바위")
elif comright == 2:
    print("comright ==> 보")

if meleft == 0:
    print("meleft ==> 가위")
elif meleft == 1:
    print("meleft ==> 바위")
elif meleft == 2:
    print("meleft ==> 보")

if meright == 0:
    print("meright ==> 가위")
elif meright == 1:
    print("meright ==> 바위")
elif meright == 2:
    print("meright ==> 보")

comran = random.randint(0, 1)
if comran == 0:
    com = comleft
else:
    com = comright

me = int(input("하나빼기 ==> 0) left , 1) right"))
if me == 0:
    me = meright
else:
    me = meleft
print(com, " ", me)
# 여기서 me 와 com 을 비교해서 승부 결정