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 a691662
# migrated from python 2.7
def checkio(game_result):
rows = game_result
cols = list(map(''.join, list(zip(*game_result))))
diags = list(map(''.join, list(zip(*[[str[i], str[len(game_result)-1-i]] for i, str in enumerate(game_result)]))))
result = []+rows+cols+diags
allequal = lambda text: True if text.count(text[0]) == len(text) else False
for str in result:
if allequal(str) and str[0] != '.': return 'X' if str[0] == 'X' else 'O'
else: return 'D'
Feb. 2, 2015