Skip to content

Instantly share code, notes, and snippets.

@rooterkyberian
Created October 14, 2016 11:55
Show Gist options
  • Save rooterkyberian/525566dbad7c6ec19152a909f700c9f8 to your computer and use it in GitHub Desktop.
Save rooterkyberian/525566dbad7c6ec19152a909f700c9f8 to your computer and use it in GitHub Desktop.
pycon2016 STX Next Tic Tac Toe golf
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