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

learn more… | top users | synonyms

1
vote
2answers
326 views

Quit Whining; Start Quining

Quit Whining; Start Quining Goal: Write a function or program that, given an integer n, will output a program in the same language that is a quine with a period of n. Description of Output Program: ...
1
vote
1answer
199 views

Quine permutation group

Write a program or function which, when run, outputs another program or function which is valid in the same language as the original program, and which itself will output another program or function ...
1
vote
0answers
159 views

Recursive zipper reincarnation

Recursive zipper reincarnation Objective: Code two separate programs A and B that when concatenating their respective outputs OA + OB creates a third program: C. When program C runs it should ...
21
votes
8answers
1k 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 ...
4
votes
1answer
161 views

Double-slit Quine

Objective: Code two programs where each of the programs outputs both source codes interlaced per character like a zipper, a Double-slit Quine. The output from a Double-slit Quine is starting ...
12
votes
7answers
902 views

Character counts in source code

Write a program that outputs a list of the number of occurrences of each unique character in its source code. For example, this hypothetical program {Source_Print_1}; should produce this output: ; 1 ...
10
votes
3answers
411 views

Sourcecode selfie

Objective: A guru once said a perfect code selfie is best shot diagonally from upper left corner. A code selfie is almost like a Quine - but rotated 45 degree clockwise. Your mission is to code a ...
25
votes
7answers
2k views

Multiplication by Self-Modification

...at least for some definition of "self-modification". The Task In this challenge, your task is to write three strings A, B and C that satisfy the following properties. The string B has length at ...
0
votes
1answer
143 views

METAscii Code Golf

Introduction Here at code colf SE, we appear to love meta-problems. Here, I've tried to compose a meta-problem that's an interesting, not-straightforward challenge. Challenge Using no inputs, your ...
12
votes
3answers
364 views

Make an almost quine

I wanted to fool a friend by giving him a quine that almost worked, but became sloppier and sloppier. Create a program that, when run, will output the program, but one character off. Either one ...
0
votes
4answers
454 views

Like a quine, but not

Very simple, write a program that at first glance appears to be a quine, but is not. Upon running, the program actually prints the source to a real quine, obviously distinct from the original program ...
15
votes
4answers
959 views

Make the largest infinity that you can!

The ordinal number system is a system with infinite numbers. A lot of infinite numbers. So many infinite numbers that it literally does not have an infinity to represent its own infiniteness. The ...
10
votes
1answer
261 views

Meta quine checker

This challenge, if you accept it, is to write three functions or programs A, B, and C: A is a quine that outputs all of A,B and C (which is also the whole content of the code in your submission). B ...
8
votes
3answers
654 views

Self-shortening Prime Tester

Let's get right in to it. Your challenge is to make a program that does these things depending on its input: If the input is a number, output "Prime" if the number is a prime number and "Not prime" ...
4
votes
1answer
304 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 ...
35
votes
6answers
4k 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 (/[a-zA-Z]+/ in regex). To be "real" your ...
9
votes
1answer
258 views

Pseudo-quine polyglot language-detection counters

Quines are fun. Polyglots are fun, too. Polyglot Quines exist, but we can raise the bar even higher. Write a file that contains a valid program for languages α, β, and γ. When the ...
7
votes
4answers
440 views

Write a binary counter in quine

Write two code fragments, which we will call s_zero and s_one. Program (l, n) consists of l copies of s_zero and s_one corresponding with the digits of n in binary, padded with s_zero on the left. ...
13
votes
14answers
2k views

Print out the first N characters of your code

You should write a program or function that receives a positive integer N as input and prints out the first N characters of your code. If N is larger than the length of your code you should continue ...
6
votes
1answer
227 views

Combinator quines

Background You have just learned what combinatory logic is. Intrigued by the various combinators you spend quite a bit of time learning about them. You finally stumble upon this particular ...
10
votes
1answer
331 views

Code a Code Slidey Puzzle!

The most recognizable sliding puzzle is the fifteen puzzle. It has a 4 by 4 grid, 15 tiles, and one empty grid space. The tiles can only move into the empty space and must always be in line with the ...
12
votes
1answer
192 views

Golf some quine stripes in different languages

You will choose m languages and write n programs in each language, each with length n*m. The kth program should output the kth character of each program, ordered by the program number. For example, ...
20
votes
6answers
2k views

Mutual Negative Quines

This was inspired by Print a Negative of your Code and Golf a mutual quine. Consider a rectangle of characters, that meet the following restrictions: Consists solely of printable ASCII characters ...
59
votes
11answers
12k views

Print a Negative of your Code

Consider a square of printable ASCII characters (code points 0x20 to 0x7E) for side length N, like the following (here, N = 6): =\ g \ 7 m+y "g L ~ e> PHq We also require each row ...
11
votes
2answers
372 views

Generalized Quine Generator

The Challenge In this challenge, you specify a source language S and a target language T. Your task is to write the following program P in the language S. If a valid program Q in the language T is ...
8
votes
5answers
579 views

Hole 2 - Prime Quine

Find Hole 1 here. Make a quine that, when run, outputs its own source code block multiple times. In fact, it must output it n times, where n in the next prime number. I think an example shows it ...
23
votes
5answers
2k views

Radioactive Quines

A radioactive quine is a quine-like program that has an even number of characters and, when run, outputs itself with exactly half of its characters removed. The output itself may be a radioactive ...
1
vote
0answers
123 views

Write the shortest one-statement python quine [duplicate]

I wrote this one-line one-statement Python quine a little while back. print (lambda x: x + str((x,)))('print (lambda x: x + str((x,)))',) The point is, it's all one line, and one function (i.e. no ...
15
votes
7answers
778 views

Write a Polyquine

A polyquine is both quine and polyglot.1 You are to write a quine which is valid in at least two different languages. This is code golf, so the shortest answer (in bytes) wins. 1 I made that up. Or ...
12
votes
2answers
623 views

How long is your (language) snake?

Following on from the third order quine challenge, your task is to write an Ouroboros program that uses as many languages as possible. That is, in language A, write a program pA which outputs program ...
20
votes
9answers
1k views

Musical Quines on an ASCII Piano

There are 88 keys on a standard piano and 95 printable ascii characters (hex codes 20 through 7E): ...
8
votes
3answers
561 views

Codegolf: Quine and Antiquine

This challenge is similar to Can you Meta Quine? A quine is a program that produces itself on STDOUT. This challenge is to produce a program A which when run produces a program B on STDOUT. Program B ...
37
votes
38answers
5k 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 ...
0
votes
0answers
392 views

Is this the shortest possible Java quine? [duplicate]

Long ago, I found a Java quine online which uses a number of very clever tricks of the Java language (you can compile this at the command line, but it will not compile in most compilers--for obvious ...
30
votes
6answers
2k views

Code that runs the Game of Life on itself

Write two rectangular blocks of code, each w characters wide and h characters tall, that implement Conway's Game of Life when arranged in a grid. (w and h may be any positive integers) For example, ...
12
votes
2answers
725 views

Introspective Programming: Code that analyzes its source and its output

Write a program that outputs the total number of characters and the frequency of each character in its source and its output. You must follow the format illustrated in the example. Example If your ...
28
votes
7answers
2k views

Newtons Method by Recursive Quines

Newtons Method by Recursively Generating Code Your task is to calculate the square root of 2 using Newton's Method - with a slight twist. Your program is to calculate an iteration using Newton's ...
12
votes
6answers
1k views

Fibonacci program lengths

Write a program with length n that outputs another program whose length is the next Fibonacci number after n. The new program must do the same thing - output another program whose length is the next ...
52
votes
24answers
8k 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 ...
14
votes
4answers
616 views

Program that permutes itself to encode a string (quine-variant)

Write a program that prints the following 80-character line: This program from codegolf.stackexchange.com permutes itself to encode a string. then accepts one line of input, then prints its ...
1
vote
2answers
306 views

Let us make a quine maker!

You are to create a program, that, given another program, and a position, will make it a quine. Namely, it needs to insert an expression at that point that evaluates to a string that is the programs ...
14
votes
7answers
2k views

The Random Quine

Write a program that is capable of randomly generating itself. It must do this based on the tokens used in its source code. If your program's source code is composed of 50 unique tokens and is 60 ...
12
votes
2answers
426 views

The poet's quine

Write a quine with 1 or more rhyme scheme from http://en.wikipedia.org/wiki/Rhyme_scheme when read. The following characters are spoken aloud: any alphanumeric words or characters not in a comment; ...
6
votes
2answers
693 views

Let us create a sonnet quine!

There are programs that will output its source code to standard output and do nothing else. They also access no external output. This type of program is known as a quine, and is a common code ...
20
votes
11answers
2k views

Mandoline quine

Write a quine... from which every other character can be removed it still be a valid quine. You can specify whether to start removing characters at the first or second character. Scoring criteria ...
25
votes
17answers
4k views

Output an image of your source code (not-quite-a-Quine)

Code golf: Print an image of the source code. Requirements Must output the image of the source code itself, not a version stored elsewhere and retrieved at run time. Code must be legible enough ...
61
votes
25answers
13k 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) Itself an acceptable answer Any obviously useless code doesn't count towards the ...
1
vote
4answers
352 views

Modifiable quine

For this challenge, write program A that when given no input, prints the code for A (a quine), but when given input, the output will be modified. The input for A will be 0 or more statements in ...
3
votes
1answer
435 views

Fibonacci is so QUINE!

Your program must output atleast half of its sourcecode in reverse. Any single part of the sourcecode as long as it is one single block of neighbouring characters. Your program should not take any ...
4
votes
4answers
152 views

Quine with prime sourcecode character distribution constraints

Your program should take no input, and no network or other connections. Your program should output it's sourcecode. The sourcecode must consist of 3 types of characters: Numeric (0-9), Alpha ...