Skip to main content

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
3 answers
270 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 ...
programjames's user avatar
1 vote
0 answers
86 views

Print my submission entry [duplicate]

Your program should print the following: **Language, XXX bytes** ``` CODE ``` or its equivalent. XXX should be substituted by ...
Sny's user avatar
  • 439
4 votes
6 answers
443 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 ...
W D's user avatar
  • 390
5 votes
6 answers
652 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: <...
math scat's user avatar
  • 9,408
17 votes
11 answers
2k 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 ...
Someone's user avatar
  • 1,620
3 votes
1 answer
213 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 ...
noodle person's user avatar
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 ...
Rydwolf Programs's user avatar
5 votes
10 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 <...
Fmbalbuena's user avatar
  • 3,867
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,...
AZTECCO's user avatar
  • 10.8k
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 ...
Rydwolf Programs's user avatar
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, ...
thejonymyster's user avatar
12 votes
2 answers
763 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 ...
emanresu A's user avatar
  • 38.8k
24 votes
4 answers
2k views

A quantum quine

Your challenge is to write a program that is a quine, meaning it prints out its own source code. For at least one individual character, when it is removed from the program's source, a single different ...
emanresu A's user avatar
  • 38.8k
9 votes
4 answers
337 views

The Roly-Poly, Square-Wheeled Quine

Code-Golf caddy Eddie Brackets was getting tired of quine challenges, which appeared to be much too easy for the grand poobahs. He has this idea to spice up things and is sending quines to the car ...
DjinTonic's user avatar
  • 636
32 votes
7 answers
4k views

I'm a lizard, cut here!

Write an \$n\$-bytes program \$AB\$ such that: it outputs an integer \$x,\ 0\lt x\lt n\$; both its \$x\$-byte prefix \$A\$ and \$(n-x)\$-byte suffix \$B\$, when run as programs, output \$AB\$. \$A, ...
Domenico's user avatar
  • 2,333
15 votes
9 answers
2k views

Full name quine

Most Unicode characters have full names, for example is "RIGHT DOUBLE QUOTATION MARK". You can find a useful reference here, just type in the character ...
emanresu A's user avatar
  • 38.8k
12 votes
14 answers
769 views

Minimal distinct character quine

Your challenge is to construct a proper quine using as few distinct characters as possible. Scoring Your score is equal to the number of distinct characters in your code, aiming to minimise this. ...
emanresu A's user avatar
  • 38.8k
6 votes
0 answers
255 views

Build a program that outputs itself encoded as a QR [closed]

The goal is simple. Write a program that outputs itself encoded as a QR code. A QR code is a way to encode data in a black and white image, similar to a 2D image. An example implementation can be ...
Ari's user avatar
  • 201
18 votes
20 answers
2k views

Hello, Permutations!

For this challenge, you will be required to write 3 programs: The first program should be a quine, i.e, it should print it's own source code. The second program should read the input and print all of ...
Manish Kundu's user avatar
  • 5,290
12 votes
3 answers
503 views

Multiplying Quines

The program should start out with 2 separate files, here named "a" and "b". "a" and "b" should be what I am calling inverse quines: "a", when run, ...
blueberry's user avatar
  • 221
19 votes
8 answers
2k views

(Error) quines, hello world, polyglots, oh my!

Introduction A quine is a program that outputs its own source code. For example, a well-known Python quine is _='_=%r;print(end=_%%_)';print(end=_%_). Running it ...
Makonede's user avatar
  • 6,500
1 vote
1 answer
202 views

Simple "hyena" program [duplicate]

Write a program that takes a string as an input. For the input: If the input doesn't match the source code, the program shall output the input intact. (Hence a cat) Otherwise, the program shall fall ...
Dannyu NDos's user avatar
  • 5,961
11 votes
2 answers
458 views

Inverse quine: print everything except your program

Write a program which will eventually, given enough time, print all possible permutations of ASCII characters (both printable and non-printable) less than or equal to its length, except itself. The ...
Purple P's user avatar
  • 1,667
22 votes
20 answers
2k views

Case invert your quine

Write a quine which attempts to invert the case of as many ascii characters in the source code as possible. For example in javascript: ...
user82867's user avatar
  • 321
39 votes
29 answers
5k views

Cat, Quine, Hello World

Write a cat program, a quine, and a Hello World in the same language such that when two specific programs of the three are concatenated in a certain order, you get the third program. It does not ...
Beefster's user avatar
  • 9,961
0 votes
1 answer
280 views

Format yourself for codegolf! [duplicate]

Task Your task is to write a program that, taking no input, outputs a string that represents a formatted codegolf answer of itself. The pattern is the following: ...
Dion's user avatar
  • 3,950
20 votes
25 answers
2k views

Counting characters

Write a function or program that accepts one character (or a string of length 1) as input, and outputs the number of times that character occurs inside the code. This program must be a Proper Quine, ...
Adam Abahot's user avatar
27 votes
1 answer
2k views

Program that compiles into itself

We've had lots of questions about quines, programs where the source code and output are identical. For compiled languages, there are other combinations: we've already had a question about writing a ...
ais523 - high effort answers's user avatar
22 votes
11 answers
3k views

Narcissistic Quine [duplicate]

Write a program/method that: Becomes a quine when the input matches the source code; Doesn't halt otherwise. This is code-golf, so shortest solution wins. Avoid any standard loopholes.
Dannyu NDos's user avatar
  • 5,961
2 votes
0 answers
83 views

Selfish Programs [duplicate]

The Challenge Write two programs P and Q such that: P and ...
Mason's user avatar
  • 2,155
4 votes
2 answers
215 views

Inter-language 2-cycle quine [duplicate]

Challenge Create 2 programs A and B The output of program A is exactly program B The output of program B is exactly program A Neither program should depend on inputs to yield the correct output A ...
Hymns For Disco's user avatar
33 votes
13 answers
6k views

Write a program that sees the New Year in itself

Write the smallest program that maps strings injectively to outputs and maps itself to 2020. To be clear, your program \$p\$ must have the following properties: every possible input string \$s\$ has ...
Dustin G. Mixon's user avatar
0 votes
1 answer
610 views

Polyglot Iterative Quine

Introduction A polyglot is a program that is valid in multiple languages at once. An iterative quine is a program that outputs another program that outputs another program that outputs the source of ...
sugarfi's user avatar
  • 2,203
13 votes
5 answers
486 views

Rock Paper Scissors (Sorta) Quine

Create three programs, which we'll call Rock, Paper, and Scissors. Each program must be unique, and accept input. If a program gets any input which is not one of the programs Rock, Paper or ...
AndrewTheCodegolfer's user avatar
1 vote
20 answers
634 views

Quine in Bytes, not Characters [duplicate]

Introduction A quine is a program that takes no input and produces a copy of its own source code as output. Writing a quine is a standard test of a programming language. Most quines operate using ...
sugarfi's user avatar
  • 2,203
1 vote
0 answers
142 views

"Know Thyself" Program [duplicate]

Challenge Write a program that takes as input a text and output "That's me!" if the input is equal to the program own source code, and "That's not me!" otherwise. Notes This is codegolf, in each ...
Ethan's user avatar
  • 127
19 votes
7 answers
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 ...
AndrewTheCodegolfer's user avatar
-4 votes
1 answer
360 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 ...
Kenzie's user avatar
  • 461
13 votes
9 answers
2k 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 ...
pommicket's user avatar
  • 3,167
34 votes
20 answers
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 ...
tjjfvi's user avatar
  • 7,350
7 votes
6 answers
303 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 ...
Geza Kerecsenyi's user avatar
31 votes
18 answers
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 ...
Geza Kerecsenyi's user avatar
6 votes
16 answers
800 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, ...
AndrewTheCodegolfer's user avatar
3 votes
2 answers
785 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 ...
AndrewTheCodegolfer's user avatar
-1 votes
5 answers
372 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 <...
Geza Kerecsenyi's user avatar
-3 votes
2 answers
320 views

Invert your code

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 ...
Geza Kerecsenyi's user avatar
11 votes
9 answers
606 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: ...
Magic Octopus Urn's user avatar
25 votes
3 answers
2k 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 ...
Beefster's user avatar
  • 9,961
18 votes
9 answers
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 ...
Christopher King's user avatar
11 votes
1 answer
668 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 ...
Nissa's user avatar
  • 3,634

1
2 3 4 5 6