Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple solution solution in Clear category for Xs and Os Referee by dunpealer
def checkio(game_result):
m = game_result
def check(rows, cols):
x = m[rows[0]][cols[0]]
if x == '.': return
return x if all(m[r][c] == x for r in rows for c in cols) else None
for i in range(3):
res = check([i], range(3)) or check(range(3), [i])
if res: return res
x = m[1][1]
if x != '.':
if (all(m[i][i] == x for i in range(3)) or
all(m[i][2-i] == x for i in range(3))):
return x
return "D"
Aug. 15, 2015
Comments: