Skip to content

Instantly share code, notes, and snippets.

@wardi
Last active December 14, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wardi/5131529 to your computer and use it in GitHub Desktop.
Save wardi/5131529 to your computer and use it in GitHub Desktop.
fun with dots
D = """
xxxxxx
xx xxxx
xxxxxxxx
xxxx
xxxxxxxxxxxx xxx
xxxxxxxxxxxxx xxxx
xxxxxxxxxxxxx xxxx
xxxx xxxx
xxxx xxxxxxxxxxxxx
xxxx xxxxxxxxxxxxx
xxx xxxxxxxxxxxx
xxxx
xxxxxxxx
xxxx xx
xxxxxx
"""
from itertools import izip_longest, chain
print u'\n'.join(u''.join(unichr(0x2800 + sum((cell == 'x') * (1 << shift)
for cell, shift in zip(cells, [0, 3, 1, 4, 2, 5, 6, 7])))
for cells in izip_longest(*chain(*[[iter(r)] * 2 for r in quad])))
for quad in izip_longest(*([iter(D.strip('\n').split('\n'))] * 4),
fillvalue='')).encode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment