-
-
Save sugyan/982590 to your computer and use it in GitHub Desktop.
self-reproducing program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(){ | |
| /* Rules: // make sure | |
| (1) anonymous function // to annotate | |
| (2) optionally self-executing // your code | |
| (3) <140 bytes // so everyone | |
| (4) no global vars // can learn | |
| (5) MIT license // from it! | |
| (6) good luck! | |
| */} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(){/*Rules: (1) anonymous function (2) optionally self-executing (3) <140 bytes (4) no global vars (5) MIT license (6) good luck!*/} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "sample", | |
| "keywords": [ "sample", "original" ] | |
| } |
Author
It's nice!
how about using unescape instead of String.fromCharCode.
function(a,b){return(a='function(a,b){return(a=Q).replace(/Q/,(b=unescape("%27"))+a+b)}').replace(/Q/,(b=unescape("%27"))+a+b)}Perfect! Replacing String.fromCharCode(39) with unescape("%27") looks a little strange but is a very cool idea.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some people say it's not a true [Quine](http://en.wikipedia.org/wiki/Quine_(computing\)) if you use
eval. I tried to create one without. It's 143 bytes and returns it's own source as a string. Any idea how to save 3 bytes?