Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Xs and Os Referee solution in Clear category for Xs and Os Referee by W.Zalicki
def checkio(game_result):
fi = game_result
rt = zip(*game_result)
draw = True
for row in fi:
if row[0] == row[1] == row[2] and row[0] != ".":
draw = False
return row[0]
for col in rt:
if col[0] == col[1] == col[2] and col[0] != ".":
draw = False
return col[0]
if fi[0][0]==fi[1][1]==fi[2][2] and fi[0][0] != ".":
draw = False
return fi[0][0]
if fi[0][2]==fi[1][1]==fi[2][0] and fi[0][2] != ".":
draw = False
return fi[0][2]
if draw:
return "D"
Nov. 5, 2017