Created
October 14, 2016 11:55
-
-
Save rooterkyberian/525566dbad7c6ec19152a909f700c9f8 to your computer and use it in GitHub Desktop.
pycon2016 STX Next Tic Tac Toe golf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def result(O): | |
r='D' | |
for d in(O,zip(*O[::-1])): | |
if d[0][0]==d[1][1]==d[2][2]:r=d[0][0] | |
for R in d: | |
if len(set(R))<2: | |
r=R[0] | |
return r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment