community
directory
books
authors
images
encyclopedia

Email:
Password:
Register

Knowledgerush Search

 

Google
  Web knowledgerush


Search for images of Quine


Message boards   Post comment

Quine

In the Scots language, a quean or quine is a girl or young woman.


In computing, A quine is a program 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.

Quines are named after W. V. Quine, who made an extensive study of indirect self-reference: he coined, among others, the paradox-producing expression, "yields falsehood when appended to its own quotation."

Sample quine in C

char x[]="char x[]=%c%s%c;%cint main() {printf(x,34,x,34,10,10);return 0;}%c"; int main() {printf(x,34,x,34,10,10);return 0;}

Sample quine in LISP

((lambda (x) (list x (list (quote quote) x))) (quote (lambda (x) (list x (list (quote quote) x)))))

Sample quine in Python

a='a=%s;print a%%`a`';print a%`a`

Sample quine in Perl

$_=q{$_=q{Q};s/Q/$_/;print};s/Q/$_/;print

Sample quine in BASIC

10 C=": PRINT CHR(49)+CHR(48)+CHR(32)+CHR(67)+CHR(61)+CHR(34)+C+CHR(34)+C": PRINT CHR(49)+CHR(48)+CHR(32)+CHR(67)+CHR(61)+CHR(34)+C+CHR(34)+C

Sample quine in Pascal

const a='const a=';b='begin write(a,#39,a,#39#59#98#61#39,b,#39#59#10,b) end.'; begin write(a,#39,a,#39#59#98#61#39,b,#39#59#10,b) end.

Sample quine in Brainfuck

(note: This should be one continuous line of code, but line breaks have been added for the ease reading on screens that are not extremely wide) ->+>+++>>+>++>+>+++>>+>++>>>+>+>+>++>+>>>>+++>+>>++>+>+++>>++>++>>+>>+>++>++> +>>>>+++>+>>>>++>++>>>>+>>++>+>+++>>>++>>++++++>>+>>++>+>>>>+++>>+++++>>+>+++ >>>++>>++>>+>>++>+>+++>>>++>>+++++++++++++>>+>>++>+>+++>+>+++>>>++>>++++>>+>> ++>+>>>>+++>>+++++>>>>++>>>>+>+>++>>+++>+>>>>+++>+>>>>+++>+>>>>+++>>++>++>+>+ ++>+>++>++>>>>>>++>+>+++>>>>>+++>>>++>+>+++>+>+>++>>>>>>++>>>+>>>++>+>>>>+++> +>>>+>>++>+>++++++++++++++++++>>>>+>+>>>+>>++>+>+++>>>++>>++++++++>>+>>++>+>> >>+++>>++++++>>>+>++>>+++>+>+>++>+>+++>>>>>+++>>>+>+>>++>+>+++>>>++>>++++++++ >>+>>++>+>>>>+++>>++++>>+>+++>>>>>>++>+>+++>>+>++>>>>+>+>++>+>>>>+++>>+++>>>+ ->>+<<<+]+++++[->+++++++++<]>.[+]>>[<<+++++++[->+++++++++<]>-] .------------------->-[-<.<+>>]<[+]<+>>>]<<<[-[-[-[>>+<++++++[->+++++<]]>++++]]] ++++++++++<]>+++<]++++++[->+++++++<]>+<<<-[->>>++<<<]>[->>.<<]<<]


More examples
perhaps add some more quines here

A quine is a special form of metaprogramme

See also self-interpreter

Referenced By

Conceptual metaphor | Curry's paradox | Define | DefinitioN | Donald Davidson (philosopher) | Indirect self-reference | Lexical definition of definition | Meta programming | Metaprogramming | Term Logic | W.V.O. Quine | W.V. Quine | W. V. O. Quine | W. V. Quine | W Quine

 

Compose Your Message

Your Email Address or Pen Name (optional):
Subject:
Your Message:
 

 

 

 

 

 

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Quine".

 

Contact UsPrivacy Statement & Terms of Use

 
Copyright © 1999-2003 Knowledgerush.com. All rights reserved.