Skip to content

Instantly share code, notes, and snippets.

@enaeseth
Created March 16, 2012 00:37
Show Gist options
  • Save enaeseth/2047893 to your computer and use it in GitHub Desktop.
Save enaeseth/2047893 to your computer and use it in GitHub Desktop.
$_ = join("", <>); tr/XO.\n//cd; m/O(.{8}O){3}|O(.{7}O){3}|O(.{6}O){3}|OOOO/s and print "Winner: O\n" and exit(0); m/X(.{8}X){3}|X(.{7}X){3}|X(.{6}X){3}|XXXX/s and print "Winner: X\n" and exit(0); print "No winner\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment