playertoken=20
computertoken=20
deck=[0,0,0]
comdeck=[0,0,0]
value=0
comvalue=0
mass=0
def gameover():
print("게임이 종료되었습니다.")
def bating():
print("배팅하시겠습니까?")
answer=input()
if (answer=="yes"):
print("얼마나 배팅하시겠습니까" "(10개이하)")
mass=input()
mass=int(mass)
playertoken-mass
computertoken-mass
if(mass>11|mass<0):
mass=0
print("값을 다시 설정해주세요")
mass=input()
def winordefeat():
if(computertoken==0):
print("승리하였습니다!!")
gameover()
if(playertoken==0):
print("패배하셨습니다...")
gameover()
def who():
first=deck[0]*deck[1]
second=deck[1]*deck[2]
third=deck[0]*deck[2]
comfirst=comdeck[0]*deck[1]
comfirst=int(comfirst)
comsecond=comdeck[1]*comdeck[2]
comsecond=int(comsecond)
comthird=comdeck[0]*comdeck[2]
comthird=int(comthird)
if(comfirst>comsecond):
if(comfirst>comthird):
comvalue=comfirst
if(comfirst<comsecond):
comvalue=comsecond
elif(comsecond>comfirst):
comvalue=comsecond
if(comsecond<comthird):
comvalue=comthird
else:
comvalue=comthird
if(value!=first|second|third):
print("3개의 값에서 곱셈을 하십시오")
if(value==first|second|third):
if(value>comvalue):
return playertoken+mass ,computertoken-mass
def 카드게임시작():
print("게임 규칙은 3장의카드를 이용하여 곱셈으로 가장 큰수를 만듭니다")
print("그 수의 합이 상대 카드의 합보다 크다고 생각할때 배팅을 할 수있습니다.")
print("배팅은 게임이 시작되면 1개를 기본으로 하게됩니다")
print("자신의 숫자 합이 낮다고 생각하면 기권으로 다음판을 할 수 있습니다.")
print("상대의 덱중 1개의 숫자만 몇인지 볼 수있습니다")
print("자신의 토큰 개수가 0이되면 패배 컴퓨터의 토큰을 0개로 만들면 승리입니다.")
publicdeck=[i for i in range(1,10)]
deck.pop(publicdeck)*3
comdeck.pop(publicdeck)*3
for i in range(playertoken):
playertoekn=-1
computertoken=-1
deck
comdeck[:1]
bating()
who()
winordefeat()
카드게임시작()