This is a bit of a random question that is more out of curiosity than any specific need.
Is it possible to write some python code that will print some stuff out, including the source code itself, without having the python code stored in a file? For example, doing something like this at the Bash prompt:
$ echo '
> print "The Code:"
> P...
Just out of curiosity, does there exist a valid zip-file (according to format spec) that, contains nothing but itself?
Put another way, does the function implemented by unzip have a fix-point?
Can I write a program to search for such a fix-point in a intelligent (not-exhaustive) way?
I've thought about the opposite as well, i.e. if zi...
I have a bizarre need here, and I am unsure of it's feasibility. I can only think how I would do it using threads (To create another thread that performs a Quine function along side a thread running the script I want to Quine and execute at the same time (without manually adding alerts everywhere!!!), but javascript doesn't have that fun...
Does a quine print the ACTUAL code of the program i.e not obfuscated or does it print the obfuscated program?
...
hi, i have written a C programme which prints itself n times, but i can't get how to reverse print the same n times.E.g, if the sample programme is :
hello
then the required output should be "olleh" for n=1.
Here's my quine programme,
#include <stdio.h>
int main()
{
int n;
char c;
FILE *f;
f=fopen(__FILE__,"r");
scanf("%d"...
This is a very interesting wiki article about programs that print their own source code without any access to physical source file (in the filesystem). Examples in the articles include C and Scheme quine programs (yeah, it appears they are called like that). I remember someone asking me long ago (about 5 years) whether I could write an S...
Do I need to use reflection to write a quine program for C#?
I read elsewhere - quine that opening the source file from disk is "cheating"
So I guess using .net reflector and/or opening the source file using System.IO is a hack.
Are there other ways other than using Reflection that I should be considering.
...