|
Its quine time
Quines: In computing, a quine is a program (a form of metaprogram) that produces its complete source code as its only output. For amusement, hackers sometimes attempt to develop the shortest possible quine in any given programming language. Recently Ive had the pleasure of writing two of them. Heres my Ruby quine. I swear its a total coincidence that it nearly looks like one I found on this website. . . . t="t=%c%s%c;printf t,34,t,34";printf t,34,t,34 And I quickly ported it to Java too. Thanks to the new powers of Java 1.5 this ones shorter than any Java quine you can find on this website. . . . class Q { public static void main(String[] a) { String t = "class Q { public static void main(String[] a) { String t = %c%s%c; System.out.printf(t, 34, t, 34); } }"; System.out.printf(t, 34, t, 34); } } Both of these quines only work on operating systems working with ASCII because I (ab-)use the fact that 34 is the ASCII code for the character ". Comments
| ||||||