1
Name:
Anonymous
2010-07-06 19:36
const char *s[15] = {
"%c%c%s%c%c%c",
"const char *s[15] = {",
"};",
"#include <stdio.h>",
"int main(void) {",
" int i;",
" puts(s[1]);",
" for (i=0; i<14; ++i)",
" printf(s[0], 9, 34, s[i], 34, 44, 10);",
" printf(s[0], 9, 34, s[i], 34, 0, 10);",
" puts(s[2]);",
" for (i=3; i<15; ++i)",
" puts(s[i]);",
" return 0;",
"}"
};
#include <stdio.h>
int main(void) {
int i;
puts(s[1]);
for (i=0; i<14; ++i)
printf(s[0], 9, 34, s[i], 34, 44, 10);
printf(s[0], 9, 34, s[i], 34, 0, 10);
puts(s[2]);
for (i=3; i<15; ++i)
puts(s[i]);
return 0;
}
the one I wrote.
4
Name:
Anonymous
2010-07-06 20:29
How long before some retard tries something inane like `cat $0`?
Oh wait
>>2 already did it.
Look, quines don't read their own program file as input. That's not a quine, that's just a program that reads itself.
5
Name:
Anonymous
2010-07-06 20:31
>>4
I argued that with the residents of esolang. I lost.
7
Name:
Anonymous
2010-07-06 20:35
>>6
Sure. But not both at the same time.
8
Name:
Anonymous
2010-07-06 21:14
infile = open(__file__, 'r')
for line in infile:
print line,
Expert python implementation.
11
Name:
Anonymous
2010-07-06 22:07
>>10
if
>>9 isn't a quine, then it's impossible to write a quine in any interpreted language.
12
Name:
Anonymous
2010-07-06 22:11
>>11
There are arguments against
>>9,8,4 that aren't applicable to
>>2 . My stance on these is "cares little."
13
Name:
Anonymous
2010-07-06 22:20
>>4
Technically a queue is a program that outputs it's own source code. Nothing specifically says it can't read it's own source as a file. These types of programs are still queues.
14
Name:
Anonymous
2010-07-06 22:37
>>13
That's not what a ``queue'' is, otherwise I don't feel like disagreeing with you.
17
Name:
Anonymous
2010-07-06 22:53
>>14
I know, it can be tiresome being a pedantic asshole.
20
Name:
Anonymous
2010-07-07 0:38
>>19
Well this one certainly doesn't qualify.
25
Name:
Anonymous
2010-07-07 9:08
>>22
No. In case I have to spell it out,
>>2 doesn't read its source file as a part of the algorithm contained within the source file. The others do.
28
Name:
Anonymous
2010-07-07 10:03
Here's one:
Interpreter is cat .
35
Name:
Anonymous
2010-08-16 21:02
I just wrote a 356 byte ELF quine and just had to revive this thread.
>>> import os
>>> os.popen("./quine").read() == open("quine").read()
True
>>> open("quine").read().encode("hex")
'7f454c4601010100000000000000000002000300010000008080040834000000c40000000000000034002000020028000400030001000000000000000080040800800408a8000000a8000000050000000010000001000000a8000000a8900408a890040802000000020000000600000000100000000000000000000000000000b9a890040881e9a8000000ba64010000b804000000bb01000000cd80b801000000bb00000000cd800000002e7368737472746162002e74657874002e6461746100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b000000010000000600000080800408800000002800000000000000000000001000000000000000110000000100000003000000a8900408a8000000020000000000000000000000040000000000000001000000030000000000000000000000aa0000001700000000000000000000000100000000000000'
36
Name:
Anonymous
2010-08-16 21:03
That's
7f454c4601010100000000000000000002000300010000008080040834000000c
40000000000000034002000020028000400030001000000000000000080040800
800408a8000000a8000000050000000010000001000000a8000000a8900408a89
0040802000000020000000600000000100000000000000000000000000000b9a8
90040881e9a8000000ba64010000b804000000bb01000000cd80b801000000bb0
0000000cd800000002e7368737472746162002e74657874002e64617461000000
00000000000000000000000000000000000000000000000000000000000000000
000000000000000000b0000000100000006000000808004088000000028000000
00000000000000001000000000000000110000000100000003000000a8900408a
80000000200000000000000000000000400000000000000010000000300000000
00000000000000aa0000001700000000000000000000000100000000000000
37
Name:
Anonymous
2010-08-16 21:19
Here's the first quine I ever wrote. Not very short, but it works.
char* e(char*s){char*r,*e;r=e=malloc(strlen(s)*2);while(*s){if(*s=='"'||*s=='\\')*(e++)='\\';*(e++)=*(s++);}*e=0;return r;}int main(){char*c="char* e(char*s){char*r,*e;r=e=malloc(strlen(s)*2);while(*s){if(*s=='\"'||*s=='\\\\')*(e++)='\\\\';*(e++)=*(s++);}*e=0;return r;}int main(){char*c=\"%s\";char*s=e(c);printf(c,s);free(s);return 0;}";char*s=e(c);printf(c,s);free(s);return 0;}
$ ./a.out | diff - quine.c
$
38
Name:
Anonymous
2010-08-16 21:59
I realize that Python is easymodo, but
x='x=%s;print x%%repr(x)';print x%repr(x)
41
Name:
Anonymous
2010-08-17 5:13
How do you pronounce 'quine'?
1. keen
2. queen (faggot)
3. kwine
4. qudder
42
Name:
Anonymous
2010-08-17 5:45
kwine. no clue if that's correct.
44
Name:
Anonymous
2010-08-17 6:07
I've always pronounced it ``kine''.
46
Name:
Anonymous
2010-08-17 17:42
>>45
I actually laughed out loud. Good job,
/prog/ .
48
Name:
Anonymous
2010-08-17 18:05
>>45
This is why we don't post links on /prog/.
49
Name:
Anonymous
2010-08-17 18:11
______
Sorry, if you hax my site, it only shows that you have no life | |
and also no respect and using your life's energy to hax someone | |
else instead of using the time to help saving world. | |
reply |______|
50
Name:
Anonymous
2010-08-17 18:18
>>49
Is that a little snake to the right of your post?
52
Name:
Anonymous
2010-08-17 20:59
>>51
Oh, it sort of reminds me of a snake period.
54
Name:
Anonymous
2010-08-18 0:47
>>53
It turned your prompt green?
55
Name:
Anonymous
2010-08-18 0:52
>>54
Why yes this is exactly what happened.
56
Name:
Anonymous
2010-08-18 5:39
I'm sorry to disappoint you ll, but cat is not a proper programming language, and neither is php.
57
Name:
Anonymous
2010-08-18 9:16
>>56
cat is an operator that always evaluates to void. It is called primarily for its side-effects.
58
Name:
Anonymous
2010-08-18 9:33
>>57
Depending on your definition of ``evaluates'',
cat evaluates to 1 if you try to cat a file it can't open and 0 otherwise, or it evaluates to the catenated contents of the files.
59
Name:
Anonymous
2010-08-18 10:04
>>58
The change to the external world as a result of a side effect is not the result of evaluation.
60
Name:
Anonymous
2010-08-18 11:35
>>59
In that case, everything evaluates to
frozen void, because once a function has been evaluated the resulting value is external to it.
61
Name:
Anonymous
2010-08-18 18:00
>>60
That really doesn't follow. Regardless, why are you afraid of functions which are dependent on their own return values?