5 ms·
I wouldn't say this is the most boring. In Python it is certainly an empty file. It was interesting to see the author work through the major obstacles one by o
by nick0garvey 4y ago
I wouldn't say this is the most boring. In Python it is certainly an empty file.
It was interesting to see the author work through the major obstacles one by one when writing a quine. Glad they didn't take the actual boring route!
- interroboink 4y agoIndeed. In C it is also the empty file, though it takes some compiler settings boogaloo to make it work. See: https://www.ioccc.org/1994/smr.hint https://www.ioccc.org/1994/smr.hint
- ilyagr 4y agoYeah. I wish the article talked about "the most boring nonempty quine".
- askvictor 4y agoMaybe the empty quine is not boring by virtue of the fact it's not like all of the other quines.
- ilyagr 4y ago2 is the odd prime for the same reason.
- deleted 4y ago[deleted]
- yesenadam 4y agoProbably anyone reading this thread knows about this already :-) but that's like the https://en.wikipedia.org/wiki/Interesting_number_paradox https://en.wikipedia.org/wiki/Interesting_number_paradox
- MitPitt 4y agoa non-empty quine in python would be `"hello world"`
- chrisshroba 4y agoJust writing a string in a python doesn’t output that string to stdout
- MitPitt 4y agoyes it does
- chrisshroba 4y ago$ ~ echo '"Hello world"' > quine.py $ ~ cat quine.py "Hello world" $ ~ python quine.py $ ~
- entelechy0 4y ago[dead]
- panzi 4y agoYes, 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.
- entelechy0 4y ago[dead]