|Notice that the stylized text to the left, which is supposed to be my name, is symmetric: it looks the same right side up as upside down. Such things are called ambigrams. Other examples you might enjoy:|
- This particular example is due to Dario Dariol, who makes nice use of an implicit type declaration and an implicit type cast to squeeze it into so few characters. Ah, the good old days of weakly typed languages!
I have included some of my examples of quines below. Three of them are not only quines, but polyglots, i.e., programs which are valid in more than one language. A pair of languages need not admit a polyglot and the existence of polyglottal quines is certainly not guaranteed by the recursion theorem.
- A C/Lisp Polyglottal Quine
- The trick to writing a polyglot is to figure out a valid way to start the program and good way to comment out parts of the code in one language at a time; the rest is easy, if tedious.
- A TeX/PostScript Polyglottal Quine
- As advertised, this is both valid TeX code and valid PostScript and produces itself as the typeset output in both languages. In other words, if you view the code as PostScript, then you will see the code itself (in Courier). On the other hand, if you TeX the code, convert it to PostScript, and view the result, then you will again see the original code (in Computer Modern TeleType).
- A C/Tcl Polyglottal Quine
- This is probably less interesting than the previous examples because C and Tcl have a similar syntax. Also, I would guess that Tcl is less well known than the languages in the other examples.
- A TeX Quine
- This was the basis for the TeX portion of the polyglottal quine above.