Quine144 views

AlgoPill
 function Quine(){
    var cc = 34;
    var str = "function Quine() { var cc=34; var str=xxxx; return str.replace('xxxx',String.fromCharCode(cc)+str+String.fromCharCode(cc)); }";
    return str.replace('xxxx',String.fromCharCode(cc)+str+String.fromCharCode(cc));
}

Problem Statement: Write a function that when executed return the definition of itself.

One Comment

  1. Posted January 23, 2011 at 10:27 am | Permalink

    Beautiful!

Post a Comment

You must be logged in to post a comment.