Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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