Python
11
Вклад в тег
def x_here(x,y):
if area[x][y][text] == X:
return True
else:
return False
if x_here(0,0) and x_here(0,1) and x_here(0,2):
return "X"
win_condition_topleft_to_botright = ((0,0),(0,1),(0,2))
def check_win_condition(first, second, third):
"""на вход три кортежа, являющиеся координатами игрового поля"""
if x_here(*first) and x_here(*second) and x_here(*third):
return "X"
def winner():
check_win_condition(*win_condition_topleft_to_botright)
check_win_condition(*win_condition_2)
check_win_condition(*win_condition_3)
check_win_condition(*win_condition_4)
Ah shit, here we go again