Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Xs and Os Referee solution in Clear category for Xs and Os Referee by CyrylWilczek
def checkio(game_result):
if game_result[0][0] == game_result[0][1] and game_result[0][0] == game_result[0][2] and game_result[0][0] != ".":
return game_result[0][0]
if game_result[1][0] == game_result[1][1] and game_result[1][0] == game_result[1][2] and game_result[1][0] != ".":
return game_result[1][0]
if game_result[2][0] == game_result[2][1] and game_result[2][0] == game_result[2][2] and game_result[2][0] != ".":
return game_result[2][0]
if game_result[0][0] == game_result[1][1] and game_result[0][0] == game_result[2][2] and game_result[0][0] != ".":
return game_result[0][0]
if game_result[0][2] == game_result[1][1] and game_result[1][1] == game_result[2][0] and game_result[0][2] != ".":
return game_result[0][2]
if game_result[0][0] == game_result[1][0] and game_result[0][0] == game_result[2][0] and game_result[0][0] != ".":
return game_result[0][0]
if game_result[0][1] == game_result[1][1] and game_result[0][1] == game_result[2][1] and game_result[0][1] != ".":
return game_result[0][1]
if game_result[0][2] == game_result[1][2] and game_result[0][2] == game_result[2][2] and game_result[0][2] != ".":
return game_result[0][2]
else: return "D"
Dec. 20, 2017
Comments: