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
10
votes
3answers
420 views

Levenshtein Your Source

The Levenshtein edit distance between two strings is the minimum possible number of insertions, deletions, or substitutions to convert one word into another word. In this case, each insertion, ...
12
votes
12answers
723 views

Travel Back in Quine

The challenge here is simple, and not at all about byte-count. Your job is to output the first 50 characters of the previous quine's source code, concatenated with the first 50 characters of yours ...
17
votes
40answers
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 ...
48
votes
5answers
1k views

TryItOnquine Challenge

(based on this post and the ensuing discussion on chat -- also, much thanks to Dennis for TIO!) The Challenge Choose a language that's currently available on the TryItOnline site, for example ...
4
votes
7answers
788 views

Make a base64 Quine!

Your challenge is to output a Base64-encoded version of your source code, and optionally a line break. You must output the correct padding, if any. Standard quine rules apply, shortest answer wins. ...
14
votes
1answer
586 views

Mutation-hardened quine

Your task is to make a program that prints out its own source. "Hey, we already have this challenge, and tons of variations of it! Why are you making another one?" you may ask, but this one is going ...
13
votes
2answers
409 views

Cyclic strings, hidden programs

Write 3 programs that do the following task: Let A, B, C source codes of those three programs; if A runs BC is produced as output, if B runs CA is produced, if C runs AB is produced; so each ...
16
votes
4answers
535 views

Quining a Pristine World

This challenge is based off of Helka Homba's question Programming a Pristine World. From that question, the definition of a pristine program is: Let's define a pristine program as a program that ...
2
votes
4answers
188 views

Write a Stepping Quine

Related Your goal, is to write a set of programs, that progresses from one to the other, one character at a time. For example. Given the starting program abcd and ...
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
199 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
246 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 ...
3
votes
1answer
304 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
263 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
331 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 ...
9
votes
1answer
278 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
305 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....
14
votes
2answers
495 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 ...
11
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,...
10
votes
6answers
984 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 ...
17
votes
1answer
406 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 ...
13
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
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
3answers
439 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
829 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
705 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 ...
45
votes
1answer
1k 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, ...
30
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
450 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
677 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 ...
26
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. ...
9
votes
2answers
243 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 ...
9
votes
4answers
429 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
599 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 ...
17
votes
5answers
824 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 ...
15
votes
5answers
918 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
360 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
762 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 [] ...
17
votes
7answers
927 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 ...
13
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
670 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
606 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 (...