Last active
December 14, 2015 18:48
-
-
Save wardi/5131529 to your computer and use it in GitHub Desktop.
fun with dots
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
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