Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Xs and Os Referee by TovarischZhukov
data_mask = [[(0, 0), (0, 1), (0, 2)],
[(1, 0), (1, 1), (1, 2)],
[(2, 0), (2, 1), (2, 2)],
[(0, 0), (1, 0), (2, 0)],
[(0, 1), (1, 1), (2, 1)],
[(0, 2), (1, 2), (2, 2)],
[(0, 0), (1, 1), (2, 2)],
[(0, 2), (1, 1), (2, 0)]]
def find (game_result, elem):
return game_result[elem [0][0]][elem [0][1]] == game_result[elem [1][0]][elem [1][1]] == game_result[elem [2][0]][elem [2][1]] != "."
def checkio(game_result):
val = [game_result[elem [0][0]][elem [0][1]] for elem in data_mask if find(game_result, elem)]
return val[0] if val else "D"
Dec. 5, 2015