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 capback250
def checkio(game_result):
# just for fun :D
if game_result[0][0] == game_result[1][0] == game_result[2][0] == "X":
return "X"
elif game_result[0][1] == game_result[1][1] == game_result[2][1] == "X":
return "X"
elif game_result[0][2] == game_result[1][2] == game_result[2][2] == "X":
return "X"
elif game_result[0][0] == game_result[0][1] == game_result[0][2] == "X":
return "X"
elif game_result[1][0] == game_result[1][1] == game_result[1][2] == "X":
return "X"
elif game_result[2][0] == game_result[2][1] == game_result[2][2] == "X":
return "X"
elif game_result[0][0] == game_result[1][1] == game_result[2][2] == "X":
return "X"
elif game_result[2][0] == game_result[1][1] == game_result[0][2] == "X":
return "X"
elif game_result[0][0] == game_result[1][0] == game_result[2][0] == "O":
return "O"
elif game_result[0][1] == game_result[1][1] == game_result[2][1] == "O":
return "O"
elif game_result[0][2] == game_result[1][2] == game_result[2][2] == "O":
return "O"
elif game_result[0][0] == game_result[0][1] == game_result[0][2] == "O":
return "O"
elif game_result[1][0] == game_result[1][1] == game_result[1][2] == "O":
return "O"
elif game_result[2][0] == game_result[2][1] == game_result[2][2] == "O":
return "O"
elif game_result[0][0] == game_result[1][1] == game_result[2][2] == "O":
return "O"
elif game_result[2][0] == game_result[1][1] == game_result[0][2] == "O":
return "O"
else:
return "D"
Feb. 9, 2016