Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Xs and Os Referee by Daniel_Pereira
def checkio(result):
simbols = 'XO'
board_size = 3
rows = [list(row) for row in result]
columns = [list(col) for col in zip(*result)]
diagonals = [
[row[i] for i, row in enumerate(result)], # main
[row[-i] for i, row in enumerate(result, 1)] # secundary
]
for lines in rows, columns, diagonals:
for line in lines:
for simbol in simbols:
if line.count(simbol) == board_size:
return simbol
return 'D'
July 18, 2015
Comments: