Skip to content

Instantly share code, notes, and snippets.

@paulproteus
Last active January 18, 2021 07:05
Show Gist options
  • Save paulproteus/016cd4ce5321119fbf81 to your computer and use it in GitHub Desktop.
Save paulproteus/016cd4ce5321119fbf81 to your computer and use it in GitHub Desktop.
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'
for i in xrange(100000):
out = to_n_and_s(i)
out = '\\n'.join(PREFIX) + '\\n' + out
for input in `python gen.py` ; do echo $input | python manage.py test ; echo " ----------------------- " ; echo " USED: $input " ; echo " -------------------- " ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment