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 maxadamski
def checkio(g):
if (g[0][0] == g[1][1] == g[2][2]) or (g[2][0] == g[1][1] == g[0][2]):
if g[1][1] != ".":
return g[1][1]
for matrix in [g, zip(*g)]:
for row in matrix:
if row[0] == row[1] == row[2]:
if row[0] != ".":
return row[0]
return "D"
Oct. 19, 2017