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 slickLash
def checkio(game_result):
patterns = [] + game_result
size = len(game_result)
for col in range(size):
patterns.append(''.join([game_result[row][col] for row in range(size)]))
patterns.append(''.join([game_result[x][x] for x in range(size)]))
patterns.append(''.join([game_result[x][size - x - 1] for x in range(size)]))
return 'X' if 'XXX' in patterns else 'O' if 'OOO' in patterns else 'D'
Feb. 21, 2015
Comments: