Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [quine]

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

10
votes
11answers
2k views

Tri-interquine - Three programs that output each other in a loop

Related: Interquine Program A outputs program B's code when run, and B outputs C's source, and C outputs A's source. This time you can't exchange two characters and exchange again :) Requirements: ...
29
votes
20answers
4k views

Interquine - Two programs that output each other in a loop

Program A outputs program B's code when run, and B outputs A's source. Requirements: Only one language across both programs Programs are different. One program that outputs itself does not qualify. ...
1
vote
1answer
196 views

Quine over network [closed]

Write a program, that sends its own source code over network. Network example is TCP/UDP or web socket. Ethernet, Bluetooth, Wi-Fi and internet over USB are allowed. No need to write receiver ...
5
votes
1answer
236 views

ASCII Reverse Quine

Okay, so everyone is familiar with the ASCII-table, correct? I'd hope so. I've been going to that site for my asciitable reference for as long as I can remember needing one. We'll be doing some fun ...
24
votes
38answers
2k views

Golf an Anagram Quine

In this question I asked you to guess an anagram quine based on its output. However it looks like we don't have a question asking to golf an anagram quine yet. So your task will be to make the ...
4
votes
1answer
296 views

Insert a simulated Ken Thompson virus into a program

A Ken Thompson virus is a virus that infects your compiler and other programs. Since it infects all your tools, you can not detect it without using tools from before the virus was introduced. Your ...
6
votes
4answers
259 views

Let's get the gang back together! [closed]

A narcissist program is a program that only accepts its own source code. A bigotous program is a program that only accepts the source code of programs semantically equivalent to itself. A gang member ...
12
votes
0answers
327 views

Make a quine writer! [closed]

Writing quines is hard. Why not have your computer write them for you! Your program will take as input an interpreter (in a Turing complete language of your choosing) for a language X, and you will ...
8
votes
1answer
275 views

Create a Muriel-like language and implementation

Muriel is a language where the only way to loop is to create a quine and execute it. Your job is to create your own language with this property and an implementation of it in a pre-existing language. ...
10
votes
1answer
293 views

Radiation hardened cyclic quine polyglot

Challenge Write two programs that: run in two different programming languages. These may not be two versions of one language. when one program is run, it outputs the second program, and vice versa....
11
votes
1answer
355 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 ...
12
votes
7answers
1k views

Golf you an anagram for great good!

The Task In this challenge, your task is to write some code which outputs one of its anagrams chosen randomly with uniform distribution but it should never output itself. Elaboration Given no input,...
9
votes
6answers
941 views

It's Anagram Quine, not just Quine!

The Task In this challenge, your task is to write a program, which takes in no input, with as many anagrams that are quine of themselves as possible. Your score will be the number of anagrams of ...
18
votes
1answer
395 views

Rotation-safe quine

Write a proper quine whose every rotation is itself a proper quine. For example, if your source code is abcdef, then: abcdef ...
12
votes
27answers
2k views

How many times will you have to golf a quine?

For this challenge, you must create a programme which takes an integer x and outputs its source x many times. Rules This is ...
14
votes
13answers
2k views

Implement the Fibonacci-quine

A Quine is a program which outputs its source when run. In this challenge, You should make a Fibonacci-quine, a variant of the quine. What is a Fibonacci-quine? A Fibonacci-quine is a program, ...
30
votes
6answers
955 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
3answers
431 views

Period 2 Reversed Quine

Your task is to write a program that outputs its own source code in reverse. However, when the reversed code is run, it should output the source code, facing the correct direction. Example Say your ...
15
votes
13answers
1k views

Print a quine that contains the input

Task You will be given a string in the input consisting only of the characters from a to z, i.e. the input will match the regex ...
18
votes
8answers
823 views

Exit code string output

You must write a program or function that, when given a nonempty string S of N printable ASCII characters†, outputs a program that will exit with exit code C, where C is the ASCII codepoint at ...
8
votes
6answers
700 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 ...
44
votes
1answer
980 views

Cyclic Levenquine

Background As most PPCG regulars will know, a quine is a program which outputs its own source code when run; and the Levenshtein distance between two strings is the minimum number of insertions, ...
29
votes
7answers
2k views

Tips for writing quines

A quine is a program that produces output that's identical to the program's source code. On this website, we generally only care about proper quines (at the time of writing, the current definition is "...
1
vote
1answer
441 views

Bowl a rectangular quine

Code-Bowling Quine Challenge You must bowl a quine following the rules of code bowling and quines but the source code must be in the shape of a rectangle (details specified below) Quine Quines ...
18
votes
8answers
1k views

Input number; Output line number

Code Golf Totally real backstory: I'm a contractor working on a website www.Sky.Net and one of our tasks it to create some self-aware program or something, I don't know I wasn't really listening to ...
9
votes
7answers
664 views

Anagram Quines (Robbers' Thread)

This is a cops-and-robbers challenge the Cops' Thread can be found here Your challenge, as robbers is to take outputs from the cops' thread and find anagrams of the output that when run as a program ...
25
votes
11answers
1k views

Anagram Quines (Cops' Thread)

This is a cops-and-robbers challenge the Robbers' Thread can be found here Your challenge is to write a program that outputs an anagram of its source code but not the original source code itself. ...
10
votes
2answers
237 views

Bidirectional Quine Chain

PPCG hasn't had enough of quines already... Challenge: Your task is to create a program "A0". When this program is run with no input, it outputs nothing. When this program is run with input, it ...
10
votes
4answers
426 views

Quining, but with Windows files!

Write a quine, that when run, creates itself in the current directory, in a source file named itself. We will be using Windows in this, so the file name (and therefore quine) must have the following ...
12
votes
4answers
587 views

Entropic Quine!

Your task is to write a program or function which: When run for the first time, outputs its source code. On subsequent executions, it should output what it output previously, but with one random ...
16
votes
5answers
816 views

Quote-Safe Quines

Your task is simple: write a program (or function) that takes no input and outputs (or returns) its source code. The catch is that when the program is wrapped in ...
16
votes
5answers
877 views

Hex Dump your Source Code

When code-golfing there will be times where you need a Hex Dump of your code, usually because you've used unprintable characters. So, why not make a program that Hex Dumps itself? The Challenge This ...
9
votes
2answers
341 views

Error (or warning) quine that's also a regular quine [closed]

(Inspired by this comment on an old question.) Background An error quine (also known as a "Kimian quine") is a program which, when compiled or run, causes the compiler/interpreter/runtime to print ...
71
votes
27answers
6k views

2016 Time Capsule String: How Versatile Is Your Language?

About a year ago on Dec 31, 2015, I had the idea that: We should make a time capsule string. Everybody gets to add one character and next new years we'll see who can make the best program out of ...
16
votes
9answers
759 views

Grow Till It's 2017

In this challenge you'll be building a program that grows as it traverses through the ages… Until it's 2017. Challenge Whenever this challenge description says “program”, you can ...
26
votes
2answers
1k views

Fastest Mini-Flak Quine

Mini-Flak is a subset of the Brain-Flak language, where the <>, <...> and [] ...
18
votes
7answers
919 views

Make an interweaving quine

Your task is to create a program that, when run, returns itself as output (this is known as a quine). However, this quine must, when it is copied n times, returns ...
14
votes
17answers
2k views

Clone yourself!

You are to create a program that creates exact clones of itself infinitely until stopped. Whatever is in the original program must be in the clones. In other words, the clones and original program are ...
43
votes
24answers
2k views

Output the first position in your program for each input character

Challenge Write a non-empty program/function p that, given a non-empty input string s, outputs the position of the first ...
23
votes
9answers
661 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 ...
5
votes
4answers
595 views

The Essential™ (comment-free) Convenient Palindromic Quine Golf

A program is "conveniently palindromic" if it is equal to the string derived when its reverse has all its parentheses (()), brackets (...
20
votes
11answers
3k views

Cheating Cyclic Quine

Concept Write a program that outputs code in its programming language. That code, when executed, must output the original program. Rules Since this is a cheating quine, you can read the original ...
23
votes
7answers
699 views

Print Polyglot Pieces

Typically, polyglots are constructed in such a manner that each language can ignore parts of the code that are present for other languages, by wrapping them in string literals, using comment syntax, ...
15
votes
2answers
773 views

Match the permutations!

Your challenge is to create a regex that matches every string permutation of itself, and nothing else. The match must also be case-sensitive. So, for example, if your regex is: ...
9
votes
2answers
429 views

The logical quine

The challenge Simply write a program that outputs its own source code. Nothing more than a regular quine. The problem We don't have a computer so we have to run the program on a programmable logic ...
32
votes
7answers
1k views

Three polyglots, two period-two quines, and one code-golf challenge

Produce a program A such that running it in language A produces Program B, and running program A in language B produces program C. Program B, when run in language B produces Program A, and running ...
9
votes
14answers
755 views

Quine Anagrams! (Robbers' Thread)

This is the robbers' thread. For the cops' thread, click here. Cops' Task For the cops' thread, click here. Robbers' Task Find an uncracked submission on the cops' thread. (A submission may only ...
23
votes
25answers
2k views

Quine Anagrams! (Cops' Thread)

This is the cops' thread. For the robbers' thread, click here. Cops' Task First, write a quine in a language of your choosing. Next, scramble the quine. Make sure to do this well as the robbers will ...
9
votes
3answers
282 views

Write a continuous quine (quine-variant)

Let's define a 2-quine as a program that prints its source code two times. For example, if the program ABC printed ABCABC, it ...
18
votes
9answers
745 views

The meta-polyglot quine

In my time on PPCG, I've noticed that quine problems and polyglot problems are quite popular. Also, meta-solutions to problems, that is, scripts which generate a program which is the solution to a ...