Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
row + columns + diagonals, then score solution in Clear category for Xs and Os Referee by piter239
from typing import List
def checkio(field: List[str]) -> str:
data = field \
+ [''.join(x) for x in map(list, zip(*field))] \
+ [''.join(field[i][i] for i in range(3))] \
+ [''.join(field[i][2 - i] for i in range(3))]
score = {sym: data.count(sym * 3) for sym in 'XO'}
return 'DXO'[bool(score['X']) - bool(score['O'])]
April 28, 2020
Comments: