Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
generate it! solution in Clear category for Xs and Os Referee by p42es
def checkio(lst):
r = range(3)
lst += [''.join([lst[j][i] for j in r]) for i in r] +\
[''.join(lst[i][i] for i in r)] +\
[''.join(lst[i][2-i] for i in r)]
if 'XXX' in lst:
return 'X'
elif 'OOO' in lst:
return 'O'
return 'D'
Sept. 22, 2015