Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
try is try solution in Clear category for Xs and Os Referee by samatdav02
def checkio(game):
diag=game[0][0]+game[1][1]+game[2][2]; diag2=game[0][2]+game[1][1]+game[2][0]
for i in range(2):
for line in game:
if all(x==line[0] for x in line) and all(x!='.' for x in line) :
return line[0]
game = list(zip(*game[::-1])) #turn 'game' to check the columns
if diag[1:]==diag[:-1] or diag2[1:]==diag2[:-1]: #diagonal checking
return game[1][1] if all(x!='.' for x in diag) or all(x!='.' for x in diag2) else 'D'
return "D"
July 1, 2019
Comments: