Hacker News new | ask | show | jobs
by panzi 1207 days ago
Yes, and if it's about the most minimal non-empty quine pretty sure it would be this:

    s='s=%r;print(s%%s)';print(s%s)
Anyway, let's make it a bit less boring and make it a C/Python polyglot (not relay) quine:

    #include<stdio.h>
    #define len int main(){char*
    #define zip return 0;}
    #if 0
    def printf(f,*a):print(f%a,end=str())
    #endif
    len
    s="#include<stdio.h>%c#define len int main(){char*%c#define zip return 0;}%c#if 0%cdef printf(f,*a):print(f%%a,end=str())%c#endif%clen%cs=%c%s%c;printf(s,10,10,10,10,10,10,10,34,s,34,10);zip%c";printf(s,10,10,10,10,10,10,10,34,s,34,10);zip
Same in C/Ruby:

    #include<stdio.h>
    #define puts(c)void main(){c;putchar(10);}
    #define dup char*
    dup
    s="#include<stdio.h>%c#define puts(c)void main(){c;putchar(10);}%c#define dup char*%cdup%cs=%c%s%c;puts(printf(s,10,10,10,10,34,s,34))";puts(printf(s,10,10,10,10,34,s,34))
Wonder if one can make that shorter.