For checking the winner sets might be useful. Just general idea:
>>> first = 'xoo' >>> second = 'xxx' >>> third = 'oox' >>> [row[0] for row in [first, second, third] if len(set(row)) == 1] # for rows ['x'] >>> set([row[i] for i, row in enumerate([first, second, third])]) # for main diagonal {'x'}
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.