Quine (Forth)

From LiteratePrograms
Jump to: navigation, search
Other implementations: BASIC | dc | Erlang | Forth | JavaScript / URI | Oz | Perl

Because of Forth's support for parse-ahead words and access to the interpreter, the shortest quine in Forth is remarkably small.

SOURCE gives access the current line being interpreted as a string, and TYPE prints a string to the console.

<<quine.f>>=
SOURCE TYPE
Download code
hijacker
hijacker
hijacker
hijacker