Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Xs and Os Referee by light2happy.718
def checkio(game_result):
for player in 'XO':
if any(row == player*3 for row in game_result):
return player
if any(''.join(col) == player*3 for col in zip(*game_result)):
return player
if all(row[i] == player for i, row in enumerate(game_result)):
return player
if all(row[i] == player for i, row in zip((2, 1, 0), game_result)):
return player
else:
return 'D'
May 19, 2015
Comments: