Questions tagged [quine]
A quine is a program which produces its source as output. This tag indicates that the challenge is related to quines. [self-referential] should be used for challenges that, while having the output have some relation to the source code, do not require fully reproducing the source.
270 questions
9
votes
2
answers
441
views
Error-Detecting Quine
Write a program with the following properties:
it must be a quine, i.e. running it outputs precisely the program itself;
it must take no input;
for at least one integer k, it must be the case that ...
15
votes
6
answers
937
views
Reconstruct your source from separate punctuation and non-punctuation
Oh dear. An overzealous cleaner has separated out the punctuation in your source code.
Write a program or function that, when passed its source code separated into punctuation and non-punctuation (but ...
1
vote
0
answers
90
views
Write a piece of Quine code that can be excuted by both C and Python [duplicate]
Write a piece of code that is compatible with both C and Python compilers/interpreters, which can output its own source code.
Quine is quite easy, but how about this double language version?
Hint:
To ...
5
votes
3
answers
422
views
Fewest Instructions for Mihály Quine
https://mihaly.barasz.com/compressed-loop/game.html
You have a simple, line-oriented “compression” language. The language works as follows:
The document must start with the ...
1
vote
0
answers
102
views
Print my submission entry [duplicate]
Your program should print the following:
**Language, XXX bytes**
```
CODE
```
or its equivalent. XXX should be substituted by ...
4
votes
7
answers
599
views
Cell`s Life #1: Simulate a plant cell
What am I?
As a plant cell, your program/function/etc. must undergo photosynthesis:
When the input is 6CO2+6H2O+light in any order, output ...
7
votes
6
answers
1k
views
Longest irreducible quine
Write an irreducible proper quine, i.e. a program that prints its own source code, which can't be reduced by removing characters to a shorter program with the same constraints.
Eg. the python quine:
<...
19
votes
11
answers
3k
views
Write a Web server quine
Write a program that accepts HTTP requests on any port of your choice above 1024, and responds to requests on any URL of your choice with its own source code. It must work with, at least, Firefox and ...
3
votes
1
answer
262
views
I reverse the source code, you reverse the source code! [duplicate]
Write a program that outputs its source code in reverse when run, and outputs its source forwards when I reverse the source. If your program is "abcd", when run with no arguments it should ...
13
votes
5
answers
1k
views
Print the answer before a given answer
In this challenge, you'll take an answer as input, and print the answer before it. If the answer passed as input is the first answer, print your own submission's source. You'll be passed any answer in ...
5
votes
11
answers
1k
views
Write a program that prints a program that's almost quine
Your task is to make a program in L that takes n as an input number, output a program p in <...
13
votes
10
answers
1k
views
Lexicographically self-comparing code
This is a quine challenge related to Write the shortest self-identifying program (a quine variant)
Write a function or a full program that compares lexicographically its source code and input, that is,...
26
votes
8
answers
2k
views
Write some Genetic Quines
In this challenge, you'll create some programs which behave similarly to genes. When you run one, it will return one of its two "alleles" (a half of its source code), and concatenating any ...
12
votes
8
answers
1k
views
Iterative Quine
Create a program which prints itself, followed by an additional program. This additional program should print the first program, itself, and then a third program. This continues until the nth program, ...
12
votes
3
answers
946
views
Jelly compression quine
The golfing language Jelly has a very complex and clever string compression system which I'm not going to go into depth about here. You can find a very good explanation here.
Basically, Jelly's string ...