Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

SHOW ME YOUR QUINES

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.

Name: Oh we're on quines now? 2010-07-06 19:53

10 LIST

Name: Anonymous 2010-07-06 20:26

super(this)

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.

Name: Anonymous 2010-07-06 20:31

>>4
I argued that with the residents of esolang. I lost.

Name: Anonymous 2010-07-06 20:33

>>5
Let's have sex

Name: Anonymous 2010-07-06 20:35

>>6
Sure. But not both at the same time.

Name: Anonymous 2010-07-06 21:14

infile = open(__file__, 'r')
for line in infile:
    print line,


Expert python implementation.

Name: Anonymous 2010-07-06 21:19

#!/bin/cat

Name: Anonymous 2010-07-06 21:39

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.

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."

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.

Name: Anonymous 2010-07-06 22:37

>>13
That's not what a ``queue'' is, otherwise I don't feel like disagreeing with you.

Name: 2010-07-06 22:40

Name: 2010-07-06 22:42

Name: Anonymous 2010-07-06 22:53

>>14
I know, it can be tiresome being a pedantic asshole.

Name: Anonymous 2010-07-06 22:54

>>17
Do tell us all about it.

Name: Anonymous 2010-07-06 23:06

print "print"

Name: Anonymous 2010-07-07 0:38

>>19
Well this one certainly doesn't qualify.

Name: Anonymous 2010-07-07 1:07

>>19
$ cat >quine.pl
print "print"
$ perl quine.pl > output.txt

$ diff -y quine.pl output.txt
print "print"                              |    print
$

Name: Anonymous 2010-07-07 2:15

>>12
Did u mena:
There are arguments against >>2,8,4 that aren't applicable to >>9.

Name: Anonymous 2010-07-07 3:26

>>21
you are doing it wrong.
but nice try.

Name: Anonymous 2010-07-07 3:34

________________________________
( Man what is with this >>23 guy )
 --------------------------------
        o   ^__^
         o  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

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.

Name: Anonymous 2010-07-07 9:53

In HQ9+:

Q

Name: Anonymous 2010-07-07 9:57

>>25
>>9 doesn't either.

Name: Anonymous 2010-07-07 10:03

Here's one:

Interpreter is cat.

Name: Anonymous 2010-07-07 10:08

Name: Anonymous 2010-07-07 10:13

>>29
>>9 doesn't output itself.

Name: 2394 2010-07-07 10:13

test

Name: 2394 2010-07-07 10:13

test

Name: 2394 2010-07-07 10:13

test

Name: Anonymous 2010-07-08 3:40

>>30

/bin/bash
cat $0

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'

Name: Anonymous 2010-08-16 21:03

That's

7f454c4601010100000000000000000002000300010000008080040834000000c
40000000000000034002000020028000400030001000000000000000080040800
800408a8000000a8000000050000000010000001000000a8000000a8900408a89
0040802000000020000000600000000100000000000000000000000000000b9a8
90040881e9a8000000ba64010000b804000000bb01000000cd80b801000000bb0
0000000cd800000002e7368737472746162002e74657874002e64617461000000
00000000000000000000000000000000000000000000000000000000000000000
000000000000000000b0000000100000006000000808004088000000028000000
00000000000000001000000000000000110000000100000003000000a8900408a
80000000200000000000000000000000400000000000000010000000300000000
00000000000000aa0000001700000000000000000000000100000000000000

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
$

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)

Name: Anonymous 2010-08-17 0:49

>>35
You broke Shiichan.

Name: Anonymous 2010-08-17 2:43

>>39
broke YOUR ANUS

Name: Anonymous 2010-08-17 5:13

How do you pronounce 'quine'?

1. keen
2. queen (faggot)
3. kwine
4. qudder

Name: Anonymous 2010-08-17 5:45

kwine. no clue if that's correct.

Name: Anonymous 2010-08-17 5:47

qudder.

Name: Anonymous 2010-08-17 6:07

I've always pronounced it ``kine''.

Name: Anonymous 2010-08-17 15:49

Name: Anonymous 2010-08-17 17:42

>>45
I actually laughed out loud. Good job, /prog/.

Name: Anonymous 2010-08-17 17:44

kuine

Name: Anonymous 2010-08-17 18:05

>>45
This is why we don't post links on /prog/.

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                                                  |______|

Name: Anonymous 2010-08-17 18:18

>>49
Is that a little snake to the right of your post?

Name: Anonymous 2010-08-17 19:00

>>50
No, a signal period.

Name: Anonymous 2010-08-17 20:59

>>51
Oh, it sort of reminds me of a snake period.

Name: Anonymous 2010-08-18 0:14

>>36

Third attempt,

$ xxd quine
0000000: 7f45 4c46 0101 0100 0000 0000 0000 0000  .ELF............
0000010: 0200 0300 0100 0000 8080 0408 3400 0000  ............4...
0000020: c400 0000 0000 0000 3400 2000 0200 2800  ........4. ...(.
0000030: 0400 0300 0100 0000 0000 0000 0080 0408  ................
0000040: 0080 0408 a800 0000 a800 0000 0500 0000  ................
0000050: 0010 0000 0100 0000 a800 0000 a890 0408  ................
0000060: a890 0408 0200 0000 0200 0000 0600 0000  ................
0000070: 0010 0000 0000 0000 0000 0000 0000 0000  ................
0000080: b9a8 9004 0881 e9a8 0000 00ba 6401 0000  ............d...
0000090: b804 0000 00bb 0100 0000 cd80 b801 0000  ................
00000a0: 00bb 0000 0000 cd80 0000 002e 7368 7374  ............shst
00000b0: 7274 6162 002e 7465 7874 002e 6461 7461  rtab..text..data
00000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000e0: 0000 0000 0000 0000 0000 0000 0b00 0000  ................
00000f0: 0100 0000 0600 0000 8080 0408 8000 0000  ................
0000100: 2800 0000 0000 0000 0000 0000 1000 0000  (...............
0000110: 0000 0000 1100 0000 0100 0000 0300 0000  ................
0000120: a890 0408 a800 0000 0200 0000 0000 0000  ................
0000130: 0000 0000 0400 0000 0000 0000 0100 0000  ................
0000140: 0300 0000 0000 0000 0000 0000 aa00 0000  ................
0000150: 1700 0000 0000 0000 0000 0000 0100 0000  ................
0000160: 0000 0000                                ....
$ ./quine | diff - quine
$

Name: Anonymous 2010-08-18 0:47

>>53
It turned your prompt green?

Name: Anonymous 2010-08-18 0:52

>>54

Why yes this is exactly what happened.

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.

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.

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.

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.

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.

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?

Name: Anonymous 2010-11-13 23:55

Name: Anonymous 2011-02-04 16:46

Name: Anonymous 2011-03-18 22:35

1
2
3

Don't change these.
Name: Email:
Entire Thread Thread List