Search the Community
Showing results for tags 'computing-principles'.
-
A Quine is a program that can output it's own source without having direct access or user intervention. (This Means no reading of the script file, prompting for source input, packaging the source, or using inbuilt source references) A Quine is not necessarily malicious or self-duplicating, but rather an attempt at a theory. Definition of Quine Why torture ourselves making this this way? The reason is to [re]prove a concept of computing: that it is possible for a turing-complete language to output it's own source-code. (or optionally, output a program in another language that outputs the original source code; aka. a multiquine ) Here, are some AutoIt3 Quines: My Quines: One-line quines from my reply on Page 2: ConsoleWrite(StringReplace("ConsoleWrite(StringReplace(%s,'%'&'s',Chr(34)&%s&Chr(34)))",'%'&'s',Chr(34)&"ConsoleWrite(StringReplace(%s,'%'&'s',Chr(34)&%s&Chr(34)))"&Chr(34)))MsgBox(0,'',StringReplace("MsgBox(0,'',StringReplace(%s,'%'&'s',Chr(34)&%s&Chr(34)))",'%'&'s',Chr(34)&"MsgBox(0,'',StringReplace(%s,'%'&'s',Chr(34)&%s&Chr(34)))"&Chr(34)))Old 2-Line Quine: $x="$x=%srnMsgBox(0,'Quine Example',StringFormat($x,Chr(34)&$x&Chr(34)))" MsgBox(0,'Quine Example',StringFormat($x,Chr(34)&$x&Chr(34)))Skeleton/Customizable Quine (Page 2) Global $gsQuine eq("MsgBox(0,'program','first exec line')") eq("MsgBox(0,'program','second exec line')") Func eq($s) Execute($s) $gsQuine&=BinaryToString(0x22287165)&$s&BinaryToString(0x0A0D2922) EndFunc $x="Global $gsQuinern%sFunc eq($s)rnExecute($s)rn$gsQuine&=BinaryToString(0x22287165)&$s&BinaryToString(0x0A0D2922)rnEndFuncrn$x=%srnMsgBox(0,'Quine Example',StringFormat($x,$gsQuine,Chr(34)&$x&Chr(34)))" MsgBox(0,'Quine Example',StringFormat($x,$gsQuine,Chr(34)&$x&Chr(34))) Any Questions? Quines by Michel Claveau: $x="MsgBox(0,'Quine','$x='&chr(34)&$x&chr(34)&@CRLF&$x)" MsgBox(0,'Quine','$x='&chr(34)&$x&chr(34)&@CRLF&$x) $g=chr(34) $x="MsgBox(0,'Q','$g=chr(34)'&@CRLF&'$x='&$g&$x&$g&@CRLF&$x)" MsgBox(0,'Q','$g=chr(34)'&@CRLF&'$x='&$g&$x&$g&@CRLF&$x) Images of past quines: - - - And for my next magic trick - an AutoIt3 / PHP Polyglot (non-quine and all too simple) A Polyglot is a script that can perform the same actions in multiple languages without manipulation of the code. ;=- <?php ;/* ConsoleWrite(";=- Hello World -=;"); ;*/ ; echo "Hello World"; ; ?> -=;In either language, this outputs ";=- Hello World -=;" to the console.