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
-1
votes
1answer
124 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 ...
19
votes
14answers
5k views

“Hello world” that creates a different “Hello world” program

Create a program, that outputs a hello world string ("Hello world", "Hello, World" etc.), and source code. Output is written to stdout or equivalent. Hello world string is embedded in the source code. ...
8
votes
4answers
316 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 ...
111
votes
49answers
32k views

Program that creates larger versions of itself (quine-variant)

You are to write a program that will output source code that is Larger than the original program (character wise) Will print another program larger than itself when run (i.e. the new program is also ...
204
votes
337answers
45k views

Golf you a quine for great good!

Using your language of choice, golf a quine. A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output. No cheating -- that means ...
85
votes
67answers
14k views

Print your code backwards - reverse quine

Write a program that prints its own source code out backwards, in other words an eniuq. Scoring: +50 if you use pull data from the Internet. +25 if you read your own source code. +1 point per ...
0
votes
20answers
444 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 ...
30
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
49answers
2k views

Code point sum quine

All the quine challenges on this site are focused on byte count, or the characters themselves. This one is different. Your challenge is to write a program that produces output which has a code point ...
22
votes
4answers
1k views

Cryptographic quine variant

Create a program that prints the MD5 sum of its source in the form: MD5 sum of my source is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx No cheating - you can't just read ...
7
votes
1answer
770 views

Build a Twitter-quine

A short while, ago, @daniel_ernston sent the following challenge to @StackCodeGolf on Twitter: @StackCodeGolf Your task is to build a program that uses the API of your choice to tweet its own ...
104
votes
99answers
12k views

Make an error quine!

Your challenge: write a "program", for a language of your choice, that causes the compiler/interpreter/runtime to produce error output when compiling/running your program which is identical to your ...
60
votes
96answers
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 ...
56
votes
63answers
8k views

A “cheating” quine

Long-time lurker, first-time poster. So here goes. In the Wikipedia page for quine, it says that "a quine is considered to be 'cheating' if it looks at its own source code." Your task is to make one ...
9
votes
6answers
727 views

Backwards and forwards polyglot quine!

You must make a polyglot that outputs its source code in one language and its source code backward in another. Unlike the normal rules, you are allowed to read the current file or use a builtin to get ...
38
votes
2answers
1k views

Radiation softened quine

It's simple: Make a proper quine where if you remove any character, it's still a quine. The difference between this and a radiation hardened quine is that if your program is ...
10
votes
6answers
354 views

Transpose quine

In this quine variant, your program must output its source code transposed across the diagonal from the top left to the bottom right. For example: your program on four lines outputs ...
28
votes
4answers
719 views

Mutant pangolin

This is a code-golf challenge whereby you need to devise a program that acts like a quine or a quine that modifies itself to illustrate machine learning. Background There is a basic artificial ...
12
votes
8answers
1k views

Quine Challenge I

Challenge In this task you have to write a program that will take input an integer N (-1e9 <= N < 0 && 0 < N <= +1e9), then compute T = (abs(N) % M+1),if N is positive ...
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 ...
57
votes
36answers
4k views

Write the shortest self-identifying program (a quine variant)

Write a program that will generate a "true" output iff the input matches the source code of the program, and which generates a "false" output iff the input does not match the source code of the ...
0
votes
0answers
116 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 ...
40
votes
14answers
2k views

Stack Exchange Vote Counter

Write a program/function that returns the vote count of its own Stack Exchange answer at the time of its execution. Your program/function may access this page (codegolf.stackexchange.com/questions/...
41
votes
9answers
5k views

Write a Quine in Plain English

Write a quine that consists of real English words separated by single spaces. A "word" is defined as a string containing only lowercase and uppercase letters (...
-4
votes
1answer
274 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 ...
41
votes
27answers
5k 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 ...
3
votes
15answers
592 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, ...
30
votes
7answers
1k views

Slow growing Quine

Make a Quine. Seems easy right? Well this quine must output itself plus its first character, which then outputs itself plus its second character, and so on. This way the quine should in several ...
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 ...
30
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 ...
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 ...
6
votes
6answers
264 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 ...
14
votes
2answers
513 views

Quine/Error Quine Polyglot

Your task is simple: Write a program that can be run in two languages. It should be a normal quine (prints its own source code) in language 1, and should be an error quine (generates an error message ...
9
votes
5answers
339 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 ...
3
votes
2answers
638 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 ...
67
votes
24answers
9k views

Write a program that downloads itself

Write a program that connects to this site, downloads the very answer in which it is posted, extracts its own source code and prints it out. The output must be identical to the source code. Shortest ...
34
votes
13answers
3k views

1-up your average quine

A 1-up quine is a program which is very similar to a quine. The one major difference is that instead of printing itself once, when n copies of the program are concatenated, the result prints the ...
19
votes
20answers
2k views

Write a Metaquine

A metaquine is a program which is not a quine, but whose output, when run as a program in the same language, is a quine. The goal of this challenge is to write a metaquine. This is code-golf, so ...
30
votes
29answers
2k views

A Quine on Every Line

Your goal is to create a program that prints itself indefinitely, with a new line after each one. Thus, if your program is a one-liner, it would be repeated on every line of the output. Example ...
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 ...
70
votes
43answers
6k views

Input ∩ Source Code

Intro The challenge is to create a program/function that prints the intersection of its own source code and a given string input. This is code golf and to be more precise: Let ...
38
votes
9answers
2k views

Make a slow error quine maker!

As part of his answer to Make an Error Quine!, @Falko proposed the following algorithm: How to create your own solution in 2 minutes? Open a new file in an IDE of your choice. Bang your ...
5
votes
2answers
595 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 ...
-3
votes
2answers
245 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 ...
-2
votes
5answers
297 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 <...
18
votes
4answers
794 views

Growing Quine Sequence

You are to write a sequence of 10 programs p1 p2 ... p10 that satisfy the following properties: pK prints ...
22
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 ...
11
votes
9answers
459 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: ...
32
votes
6answers
2k views

Mirror quine (or my head hurts)

I was reading Print your code backwards - reverse quine And I thought, this could be more interesting if your backwards code is also executable. So this challenge will have all the rules and ...
23
votes
9answers
684 views

Incremental Quine

​Your task is to write a program or function that outputs the first character of its source code, then the second, then the third... each time it is run. For example, if your program was ...