Skip to content

Instantly share code, notes, and snippets.

@filipesilva
Created November 9, 2016 15:40
Show Gist options
  • Save filipesilva/ced82e705adf2795a6ef995489af839f to your computer and use it in GitHub Desktop.
Save filipesilva/ced82e705adf2795a6ef995489af839f to your computer and use it in GitHub Desktop.
self-rep.js
let program = `
let program = \`#ref\`;
let delimiter = String.fromCharCode(92) + String.fromCharCode(96);
program = program.replace(\`#ref\`, program.replace(/\`/g, delimiter));
console.log(program);
`;
let delimiter = String.fromCharCode(92) + String.fromCharCode(96);
program = program.replace(`#ref`, program.replace(/`/g, delimiter));
console.log(program);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment