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 keplers
def checkio(game_result):
rows = game_result
cols = ["".join(i) for i in list(zip(*game_result))]
diagonal1 = ["".join(game_result[a][a] for a in range(3))]
diagonal2 = ["".join(game_result[a][2 - a] for a in range(3))]
lines = rows + cols + diagonal1 + diagonal2
return "X" if "XXX" in lines else "O" if "OOO" in lines else "D"
Aug. 14, 2017