>>13
Also, this isn't something any professor's talked about, though I've seen this discussed here. Alternatives to allocating the necessary space? Differences?
>>17
What kind of challenge is it then? Also try it with a compiled language when >>6 is not called "writemyself.c".
Also: quine: /kwi:n/ /n./ [from the name of the logician Willard van Orman Quine, via Douglas Hofstadter] A program that generates a copy of its own source text as its complete output.
i.e., not one that just reads its source text (in which case it is not a generated copy of its source text).
>>27
Just look it up. A quine does not use its source file as input, by definition. http://www.nyx.net/~gthompso/quine.htm char*f="char*f=%c%s%c;main(){printf(f,34,f,34,10);}%c";main(){printf(f,34,f,34,10);}
A quine is a computer program which takes no input and produces a copy of its own source code as its only output.
MOV 0, 1
Name:
Anonymous2011-05-31 17:15
#define qnb "You are now breathing manually."
#include <stdio.h>
#define b "\\"
#define n "\n"
#define q "\""
#define bb "b"
#define nn "n"
#define qq "q"
#define bn "#define "
#define nb " "
#define bbb "#include <stdio.h>"
#define nnn "int main(void) { puts("
#define qqq "); return 0; }"
#define bnq "bn qq nn bb nb q qnb q n bbb n bn bb nb q b b q n bn nn nb q b nn q n bn qq nb q b q q n bn bb bb nb q bb q n bn nn nn nb q nn q n bn qq qq nb q qq q n bn bb nn nb q bn q n bn nn bb nb q nb q n bn bb bb bb nb q bbb q n bn nn nn nn nb q nnn q n bn qq qq qq nb q qqq q n bn bb nn qq nb q bnq q n nnn n bnq n qqq"
int main(void) { puts(
bn qq nn bb nb q qnb q n bbb n bn bb nb q b b q n bn nn nb q b nn q n bn qq nb q b q q n bn bb bb nb q bb q n bn nn nn nb q nn q n bn qq qq nb q qq q n bn bb nn nb q bn q n bn nn bb nb q nb q n bn bb bb bb nb q bbb q n bn nn nn nn nb q nnn q n bn qq qq qq nb q qqq q n bn bb nn qq nb q bnq q n nnn n bnq n qqq
); return 0; }
I have developed a compile-time quine in C. Compilation instructions are in the transcript below. $ cat anus.c
anus.c:1:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
compilation terminated due to -fmax-errors=1.
$ gcc -w -fmax-errors=1 anus.c
anus.c:1:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
compilation terminated due to -fmax-errors=1.
$ gcc -w -fmax-errors=1 anus.c 2>&1 | diff anus.c -
$
kimian.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
kimian.c:1:46: warning: multi-character character constant
kimian.c:1:55: warning: character constant too long for its type
>>50
It's a frankenstein monster language with concepts from Smalltalk, Lisp and Perl, with Perlish (read: unreadable, write-only) syntax and lots of special case.
So, it has a lot in common with C++.
>>56
In my browser's js engine, it's only a valid quine if it's formatted thusly: (function () {
alert("(" + arguments.callee.toString() + ")();");
})();
The More You Know
Name:
Anonymous2011-06-01 19:51
>>57
The more you realize that she wants to shove her dildo up your ass. I hope you enjoy wearing nylons you douche.