Saturday, February 11, 2006

First Puzzle

This is a programming puzzle:

Write a program that writes itself. That is, the output of the program is whatever the code of the program looks like. So, if the code of the program looks like this:

if (this was a real language){
it would not be comprehensible;
}

Then, if it wrote itself, it woudl output:

if (this was a real language){
it would not be comprehensible;
}

No comments: