Very simple, write a program that at first glance appears to be a quine, but is not. Upon running, the program actually prints the source to a real quine, obviously distinct from the original program in some way, preferably creative, but since this is a popularity contest, the answer with the most upvotes wins.

Standard Loopholes which are no longer funny are forbidden.


closed as off-topic by DJMcMayhem, Blue, cat, GamrCorps, Arcturus Apr 24 '16 at 3:38

  • This question does not appear to be about programming puzzles or code golf within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Can I allow requiring specific input in my answer, or does my program have to work regardless of input? \$\endgroup\$ – ASCIIThenANSI May 13 '15 at 17:13
  • \$\begingroup\$ I think it has to work regardless of the input. \$\endgroup\$ – SuperJedi224 May 13 '15 at 21:05
  • \$\begingroup\$ Why does this question have so many dislikes? \$\endgroup\$ – Loovjo May 31 '15 at 12:15
  • \$\begingroup\$ @loovjo I have no idea. Vague? Open ended? \$\endgroup\$ – Christopher Wirt May 31 '15 at 23:13
  • 4
    \$\begingroup\$ I'm voting to close this question as off-topic because it's an [underhanded] challenge, which was on-topic a year ago, but is now off-topic by community consensus. \$\endgroup\$ – DJMcMayhem Apr 23 '16 at 20:21



Well, whether this looks like a real quine to you depends on whether you're used to CJam or GolfScript, but anyway, it looks like and prints the standard quine:


Wait, isn't that the same thing?

Nope, there's a space at the end of the first code. I believe the same thing would work in almost any language with almost any quine.

Test it here.

  • 3
    \$\begingroup\$ CJam. What can it do? Everything, apparently... \$\endgroup\$ – ASCIIThenANSI Apr 29 '15 at 16:44


"Hello, world!"

It's easy: In H9+, anything other than H, 9, or + is ignored, and therefore, this is a quine. Or is it?

Nope. H actually outputs Hello, world!, with no quotes.





The output actually has single quotes instead of double quotes.

Try it here



This one can be quite tricky to newer users.

Function[Print[StringJoin[ToString[FullForm[#0]], "[];"]]][];


Some people might not notice the #0 as not being part of the FullForm. In the output, it is replaced with Slot[0]. Everything else is the same.



Recursion can be tricky at times.

let s = "let s = " ++ show s ++ " in putStrLn s" in putStrLn s

This actually outputs the same as 's = "let s = " ++ show s in putStrLn s', namely 'let s = "let s = \"let s = \\\"let s = \\\\\\\"let s = \\\\\\\\\\\\\\\"let s = \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"...'

Basically, Haskell is trying to let s be equal to itself, with let s = appended to it, and escaping the string.

Obviously, in order to escape " you need \", and in order to escape \ you get \\, which is how the long stream of backslashes is formed.


Not the answer you're looking for? Browse other questions tagged or ask your own question.