Yow-Hann Lee - Software Happens

All things Computer Science, .NET & WWW

  Home  |   Contact  |   Syndication    |   Login
  131 Posts | 7 Stories | 35 Comments | 50 Trackbacks

News


Article Categories

Archives

Post Categories

About

The C# version:

class A{const string b=@"class A{{const string b=@{1}{0}{1};static void Main(){{System.Console.Write(b,b,(char)34);}}}}"static void Main(){System.Console.Write(b,b,(char)34);}}

To refer back to the question, click here.

Now, try this in JavaScript.

This is actually less so a BrainSharpener and more of an exercise for people who are learning new languages. The official word for this type of self-replicating program is called a "quine". Puts a new twist to writing your first program in a new language (as opposed to the typical "Hello World" program). If you'd like to jump on Ruby, try writing a quine.

posted on Monday, November 13, 2006 10:41 PM