Skip to content

Instantly share code, notes, and snippets.

@paulproteus
Last active August 29, 2015 14:03
Show Gist options
  • Save paulproteus/1237524acb81a69ede66 to your computer and use it in GitHub Desktop.
Save paulproteus/1237524acb81a69ede66 to your computer and use it in GitHub Desktop.
➜ n_and_s cat gen.py
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
for i in xrange(100000):
print to_n_and_s(i)
➜ n_and_s for input in `python gen.py` ; do
echo $input | python manage.py test
done
➜ n_and_s for input in `python gen.py` ; do
echo $input | python manage.py test
done
➜ n_and_s 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