Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Xs and Os Referee by Gabbek
def checkio(field):
for row in field:
if row[0] != '.' and row[0] == row[1] == row[2]:
return row[0]
rotated_field = zip(*field)
for x in rotated_field:
if x[0] != '.' and x[0] == x[1] == x[2]:
return x[0]
if field[1][1] != '.' and (field[0][0] == field[1][1] == field[2][2] or field[0][2] == field[1][1] == field[2][0]):
return field[1][1]
return 'D'
Oct. 12, 2015
Comments: