An Interview Question That Prints Out Its Own Source Code (In Ruby)
skorks.com
skorks.com
The Ruby program outputs Python that outputs Perl that outputs Lua that outputs OCaml that outputs Haskell that outputs C that outputs Java that outputs Brainfuck that outputs Whitespace that outputs Unlambda that outputs the original Ruby program.
(I was unable to get it to work when I tested it, but I still find it quite impressive!)
Hint: It is a generalization of a quine.
That being said, something tickles the back of my head... Are quines combinatorial? Something about a program that prints its own source code makes me think of some of Raymond Smullyan's various problems in the field...
function quine_test { diff <(ruby $1) <(cat $1); }
Usage: $ quine_test quine.rb