Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Quine (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Source code inspection ==== Quines, per definition, cannot receive ''any'' form of input, including reading a file, which means a quine is considered to be "cheating" if it looks at its own source code. The following [[Unix shell|shell]] script is not a quine: <syntaxhighlight lang="bash"> #!/bin/sh # Invalid quine. # Reading the executed file from disk is cheating. cat $0 </syntaxhighlight> A shorter variant, exploiting the behaviour of [[Shebang (Unix)|shebang]] directives: <syntaxhighlight lang="bash"> #!/bin/cat </syntaxhighlight> Other questionable techniques include making use of compiler messages; for example, in the [[GW-BASIC]] environment, entering "Syntax Error" will cause the interpreter to respond with "Syntax Error". Quine code can also be outputted visually, for example it's used to visualize the neutral zone in [[Yars' Revenge]], along with [[Syntactic_sugar#Syntactic_saccharin|syntactic saccharin]], to obfuscate the source code.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)