Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Xs and Os solution in Clear category for Xs and Os Referee by Nirmala
def checkio(game_result):
for p in game_result:
a = game_result[0]
b = game_result[1]
c = game_result[2]
if a == "XXX" or b == "XXX" or c == "XXX":
return "X"
elif a[0] == b[0] == c[0] == "X" or a[1] == b[1] == c[1] == "X" or a[2] == b[2] == c[2] == "X":
return "X"
elif a[0] == b[1] == c[2] == "X" or a[2] == b[1] == c[0] == "X":
return "X"
elif a == "OOO" or b == "OOO" or c == "OOO":
return "O"
elif a[0] == b[0] == c[0] == "O" or a[1] == b[1] == c[1] == "O" or a[2] == b[2] == c[2] == "O":
return "O"
elif a[0] == b[1] == c[2] == "O" or a[2] == b[1] == c[0] == "O":
return "O"
else:
return "D"
Dec. 18, 2016