Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Nice and Neat! solution in Creative category for Xs and Os Referee by ArchTauruS
"""Nice and Neat!
"""
def checkio(game_result):
wins = [
game_result[0][0] + game_result[0][1] + game_result[0][2],
game_result[1][0] + game_result[1][1] + game_result[1][2],
game_result[2][0] + game_result[2][1] + game_result[2][2],
game_result[0][0] + game_result[1][0] + game_result[2][0],
game_result[0][1] + game_result[1][1] + game_result[2][1],
game_result[0][2] + game_result[1][2] + game_result[2][2],
game_result[0][2] + game_result[1][2] + game_result[2][2],
game_result[0][0] + game_result[1][1] + game_result[2][2],
game_result[0][2] + game_result[1][1] + game_result[2][0]
]
return 'X' if 'XXX' in wins else 'O' if 'OOO' in wins else 'D'
Nov. 12, 2018