Questions tagged [quine]

A quine is a program which produces its source as output. This tag indicates that the challenge is related to quines.

Filter by
Sorted by
Tagged with
-5
votes
0answers
117 views

Smallest self-hosting golfing language [on hold]

Implement a golfing language that is implemented in itself. Formally speaking: The original compiler O (an executable file assumed to be implemented in other language X), when given its own source ...
18
votes
7answers
3k views

Y2K… in 2019?

It's August 10th, 2019, but your task still involves Y2K. Weird, right? Create a program that prints itself, with a two digit number appended to it. The first time you run it, it should append 00 to ...
-4
votes
1answer
234 views

longest ungolfable quine [closed]

Create a quine that cannot be golfed. Your score is your byte count, where higher is better. If someone finds a shorter version, their score is your original byte count, and you lose points Scoring ...
59
votes
88answers
10k views

Print the last, middle and first character of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order. The middle character is defined as follows, assuming a source length of ...
10
votes
9answers
1k views

n-level Ouroboros Quine

This 128-language quine ouroboros (a program which outputs a program in another language, which outputs a program in yet another language, (125 languages later), which outputs the original program) is ...
29
votes
17answers
3k views

A quine of sorts

Given a string x, output the characters in x sorted according to the order of appearance in your source code. Examples ...
6
votes
6answers
255 views

Inverse-quotes-quine, inverted (pt. 2)

Based on a comment by Jo King on my previous question (called 'Inverse-quotes-quine'), I present this new question. The rules are similar, but just, the opposite: If your program is run normally, all ...
29
votes
18answers
2k views

Inverse-quotes-quine

The prospect of this challenge is: If your program is run normally, all of the code in the speech marks (" - double quotes) should be printed. If your program is ...
3
votes
15answers
575 views

The anti-narcissist

The narcissist is a program which, given its own source as input, prints a truthy value and, given anything other than that, prints a falsey value. Today, we're reversing this. Create a program that, ...
3
votes
2answers
610 views

A poly-moly-holy quine. (Well, it's not, but the title's cool.)

This is an answer chaining puzzle, where each answer must add on to the last. The \$n\$th submission must output its own source code in the \$n\$th language and the \$n−1\$ languages before it. A ...
-2
votes
5answers
292 views

45 degree quine [closed]

A very simple golf this time, but should be fun to do. Challenge Output your code, but rotated 45 (or -45) degrees. E.g: lorem ipsum dolor sit amet becomes <...
-3
votes
2answers
243 views

Invert your code [closed]

Challenge Return the full contents of your program, but inverted. How do your invert something? Well, Letters: Take the position of the letter in the alphabet, subtract from 26, and use the letter ...
11
votes
9answers
435 views

The Great Pyramid of Quine

The task is a rather simple quine challenge with a twist, you must output your source code in the shape of a pyramid. The shape of a pyramid is defined below: ...
21
votes
3answers
1k views

Meta-bowling Golf

Your task is to create the shortest program (A) that outputs another program (B) with the most unique bytes, which in turn outputs the original program (A). Essentially, you are golfing one half of a ...
16
votes
7answers
2k views

Write the longest period iterating quine bounded by 500 bytes

Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes. That is, if you repeat the following steps: Start with your ...
5
votes
0answers
224 views

Radiation is Painful

A radiation-hardened quine can take a hit and stay standing, but nobody ever said that the quine can't be a wuss about it. For this challenge, you should write a quine that: If no characters are ...
2
votes
0answers
150 views

Heart-shaped quine [closed]

As you may or may not know, Valentine's day is getting close. So today, my task for you is: Write a heart-shaped quine Rules: Code should look like an identifyable heart shape, i.e. Has two round ...
10
votes
13answers
1k views

Quine outputs itself in binary

Your task, if you wish to accept it, is to write a program that outputs its own source code in the binary UTF-8 representation. Rules The source must be at least 1 byte long. Your program must not ...
5
votes
3answers
556 views

A Multipurpose Quine

I personally love quines, but they all seem to be so... static. So why not create a quine that can do more. Challenge The challenge here is to create a quine that without any sort of input is a ...
7
votes
1answer
246 views

A Radiation Hardened Palindromic Quine

There are radiation hardened quines, palindromic quines, but has anyone tried both?! I think not! Rules So the challenge here is to make a quine that if any symbol is deleted it prints its original ...
1
vote
1answer
220 views

Pumping quine radix

Inspired (you don't need to know them for this challenge) by the Pumping Lemma for various languages, I propose the following challenge: choose some basis \$B \geq 2\$ and an integer \$n \geq 0\$ ...
3
votes
2answers
237 views

Special quines and code golf, hooray!

Make a quine. Simple enough, except it has to be a palindrome and accept input. Now, any side of a palindromic quine is one half of it. For example, one side of the hypothetical quine AAAA is AA. One ...
3
votes
13answers
381 views

Create a kind of quine, such that the program prints one character of itself, then two, then three and so on

Create quine variant such that the program prints its first character, then the first two, then three and so on until the whole program is printed. Example Suppose your code is ...
16
votes
10answers
875 views

Q​u​i​n​e R​e​l​a​y​!

Quine Relay! A quine relay of order \$n\$ is a series of programs \$P_1\dots P_n\$ in distinct languages such that each program \$P_i\$ outputs \$P_{i+1}\$ and \$P_n\$ outputs \$P_1\$. For example, ...
14
votes
1answer
604 views

Make a Radiation Hardened Quine

Last night I was looking for the Radiation Hardened Quine challenge, but I couldn't find it. Turns out no one has asked it yet! So here it is: Your task is to make a quine, that is a non-empty ...
1
vote
0answers
93 views

Help us escape the quine factory! Put messages into quines [duplicate]

I've been enslaved in a quine factory. The other workers and I can't communicate with the outside world, we can only slave away making quines all day. The masters will reject any work that isn't a ...
31
votes
14answers
4k views

2 Cats in a Quine

Challenge Make two programs, A and B, which are both cat programs in the same language. When concatenated, AB (also in the same language) should be a quine. For example, suppose ...
20
votes
7answers
1k views

Rolling Quine Dice

Create a program that outputs itself. However, if the source code is repeated n times (meaning to concatenate a copy of the source code to the end n-1 times), then there should be 1/n probability ...
11
votes
0answers
276 views

quine program in C using only macros [closed]

Asked on Stack Overflow, but they suggested to move it here A while ago I was reading about quines. It made me wonder if it possible to write a macro in C which will print itself, without writing any ...
30
votes
12answers
2k views

Write a Quine Suite

We've had a lot of quine challenges, but a lot of the quine formats are similar, lets create some variance in our quines. Your task is to create a selection of programs in the same language (at least ...
11
votes
1answer
612 views

Auto cycler quine

Make a quine but with a twist. Statement The quine prints its code but puts its first character at the end. (You can do it in reverse but include that note in your answer) The output must then be a ...
9
votes
5answers
579 views

Quine of orders

Write a program that, when run in different languages, outputs a different byte permutation of the code in each language. The exact source code is counted as one permutation. Here "different language"...
5
votes
3answers
236 views

Intron Adder Quine

In the context of quines, an intron (or payload) is a part of a quine that serves no purpose in producing output, but is still included in the data section. For example: ...
9
votes
5answers
331 views

Ticking Quine-Bomb!

Challenge: Create a program or function that takes an integer input, which outputs a new program/function as specified below. Input: Integer n: Time in seconds ...
41
votes
27answers
4k views

Self-growing code codee codeee codeeee

Write a program (or function) (let's call it P1), that when run, outputs another program P2 of the same language and exactly 1 byte longer than P1. Program P2 when run, should output a 3rd program P3 ...
18
votes
4answers
883 views

Build a half cardinal cyclic quine

A half cardinal cyclic quine is a cyclic quine with two states, one perpendicular to the other. Rules You can decide which rotation you want to implement, clockwise or counter-clockwise. Once ...
3
votes
1answer
268 views

Turn Your Program into a Snake! [duplicate]

...or "snakes but not too long". Inspired by this challenge and this comment. Task Write a program or a function that takes no input and outputs its own source code formatted as a snake according ...
28
votes
18answers
5k views

Take a stand against long quine lines

or: Build a vertical quine Inspired by Take a stand against long lines. Your task is to build a vertical quine with as short a line length as possible. Scoring Shortest line length (excluding ...
18
votes
9answers
714 views

The NX source-length problem [duplicate]

On PPCG, we have had lots of challenges where the length of your output is dependent on the length of your source code. For the purposes of this challenge, we will call these Source-length problems. ...
4
votes
4answers
278 views

Program Sequence Generator

Your challenge is to implement a cyclic Program Sequence Generator (PSG) in a language of your choice. Given a language, L, a PSG in L is a program in L that outputs a PSG in L. Some properties of a ...
18
votes
7answers
1k views

Russian Nesting Quine

A Russian nesting doll, more commonly known as a Matryoshka doll, is a doll which contains a smaller version of itself, which then contains another smaller version of itself, which contains a smaller ...
27
votes
6answers
956 views

Mutually Exclusive Quines

Your challenge is simple. Write two programs that share no characters which output each other. Example Two programs P and Q are mutually exclusive quines if: P outputs Q Q outputs P There is no ...
8
votes
1answer
370 views

Cyclic Weak Levenquine

This question asking us to make a "Cyclic Levenquine" has gone unanswered. So today we will ask a slightly simpler version. In this challenge we will define a K-Levenquine to be a program whose ...
21
votes
11answers
3k views

Is it a substring of itself?

Given a string, return whether the string is a substring of the program's source code. Standard quine rules apply, meaning you cannot read your own source code. The length of the input is guaranteed ...
18
votes
8answers
1k views

Output the Source, One Bit at a Time

Write a non-empty program or function that when called outputs a single value, 1 or 0, and when called multiple times, the output numbers produce the binary representation of your program's source ...
11
votes
6answers
738 views

Invert a Quine!

We all know what a quine is. An inverted quine is a non-empty program that prints the inverse of its source code without reading its source code, and consists solely of printable-ASCII characters (...
4
votes
6answers
447 views

A Complementary Quine

Write a quine that outputs the complement of the source code from the smallest containing power of two. Here's an example: IN : source OUT: \r\x11\x0b\x0e\x1d\x1b ...
7
votes
4answers
668 views

Unfurling-Safe Quine

Write a proper quine containing at least one newline/linefeed whose every unfurling is either itself a proper quine or outputs the original quine. Your answer can mix and match outputting itself and ...
9
votes
7answers
772 views

Code-Golf Assembly Line

Note: This challenge has nothing to do with actual assembly language. As the head of Code-Golf Factory Inc., you must create an assembly line to generate a specific piece of code. Today, the foreman ...
16
votes
19answers
1k views

Generate programs that print n times their length

Given a nonnegative integer n, your solution must output a program in your chosen language whose output has n times as many ...