Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
a == b == c != '.' solution in Clear category for Xs and Os Referee by furas
def checkio(game_result):
for n in range(3):
# check in column
if game_result[0][n] == game_result[1][n] == game_result[2][n] != '.':
return game_result[0][n]
# check in row
if game_result[n][0] == game_result[n][1] == game_result[n][2] != '.':
return game_result[n][0]
# check on diagonal
if game_result[0][0] == game_result[1][1] == game_result[2][2] != '.':
return game_result[0][0]
# check on diagonal
if game_result[0][2] == game_result[1][1] == game_result[2][0] != '.':
return game_result[0][2]
return "D"
#These "asserts" using only for self-checking and not necessary for auto-testing
April 29, 2014
Comments: