# Tic-Tac-Toe
# input, 2 numbers
'''
0,0 0,1 0,2
1,0 1,1 1,2
2,0 2,1 2,2
'''
class ttt:
def __init__(self):
print('Tic-Tac-Toe Init S')
self.map = []
for i in range(3):
v = [0] * 3
self.map.append(v)
self.drawMap()
self.controller()
def drawMap(self):
for i in range(3):
for j in range(3):
if self.map[i][j] == 0:
print('_ ',end='')
elif self.map[i][j] == 1:
print('O ',end='')
elif self.map[i][j] == 2:
print('X ',end='')
print()
a=0
def controller(self):
for i in range (9999999999999999999):
n, m = map(int, input().split())
if (i%2==0):
a=1
elif (i%2==1):
a=2
if (a==1):
print('O turn')
self.map[n][m] = 1
self.drawMap()
elif(a==2):
print('X turn')
self.map[n][m] = 2
self.drawMap()
def winlose(self): 이거 구해오기 조건문 다 구해오기 x or O 로 해서 조건문 8개로 구해오기
if (self.map[0][0], self.map[1][1], self.map[2][2] == 1 or 2):
print()
x = ttt()
top of page
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
20230504
20230504
댓글 0개
좋아요
댓글(0)
bottom of page