Habari! Blog

About Recursion

Posted by: Michael Justin on: July 16, 2008

In order to understand recursion, one must first understand recursion.”

Read more: http://en.wikipedia.org/wiki/Recursion

And here is a C# program which prints its own source code as output:

class Quine {
  static void Main() {
    string f = "class Quine {{{2} static void Main() {{{2}  string f = {0}{1}{0};{2}  System.Console.WriteLine(f, (char)0x22, f, (char)10);{2}  }}{2}}}";
    System.Console.WriteLine(f, (char)0x22, f, (char)10);
  }
}

Found at: http://c2.com/cgi/wiki?QuineProgram

Leave a Reply

You must be logged in to post a comment.

 

July 2008
M T W T F S S
« Jun   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Blog Stats

  • 8,686 hits