Skip to content

Instantly share code, notes, and snippets.

@trvrm
Last active January 9, 2017 13:45
Show Gist options
  • Save trvrm/b2c110282e6054c942d59ca7226d57c3 to your computer and use it in GitHub Desktop.
Save trvrm/b2c110282e6054c942d59ca7226d57c3 to your computer and use it in GitHub Desktop.
Inspired by Gödel Escher Bach, a self replicating program using a custom Gödel numbering system. Has to be run in Python3.
number= 141141214201198209217210140201200211199201200140216210205214212110141214201198209217210144139161214201198209217210139140216210205214212110141193148191141151142142148149144210140200211209218205200140201200211199201200132143132141148148149145193149191141151142142148149144210140200211209218205200140214204199132201215208201132210161161148132202205132139139132158210132197200198209197208132161132201200211199201200
decode = lambda n: '' if 0==n else chr(divmod(n,10**3)[1]-100) + decode(divmod(n,10**3)[0])
print('number=',number)
print(decode(number))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment