Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Xs and Os Referee by cougarmilk
def checkio(result):
row1, row2, row3 = result
dia1 = row1[0] + row2[1] + row3[2]
dia2 = row1[2] + row2[1] + row3[0]
columns = [row1[i] +row2[i] + row3[i] for i in range(3)]
all = [row1,row2,row3,dia1,dia2] + columns
return 'X' if 'XXX' in all else 'O' if 'OOO' in all else 'D'
Nov. 23, 2016