Skip to content

Instantly share code, notes, and snippets.

@rahatarmanahmed
Created September 1, 2016 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahatarmanahmed/27a007d27acbdc023ce8b22f904bf280 to your computer and use it in GitHub Desktop.
Save rahatarmanahmed/27a007d27acbdc023ce8b22f904bf280 to your computer and use it in GitHub Desktop.
ASCII Godel Numbering
var P = require('livecoding-primes');
function asciiGodelNumber(str) {
var primes = P.primes()
return str.split('')
.map(c => c.codePointAt(0))
.map(n => Math.pow(primes.next().value, n))
.reduce((acc, n) => acc*n, 1)
}
return asciiGodelNumber('1+1=2')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment