Skip to content

Instantly share code, notes, and snippets.

View paulproteus's full-sized avatar

Asheesh Laroia paulproteus

View GitHub Profile
def to_n_and_s(i):
x = bin(i)
assert x.startswith('0b')
x = x[2:]
x = x.replace('1', 'n\\n')
x = x.replace('0', 's\\n')
x += 'c\\n'
return x
PREFIX = 'snns'