Tagged Questions

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

6
votes
4answers
425 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
104 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 ...
14
votes
7answers
624 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
478 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 ...
17
votes
9answers
856 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): ...
7
votes
3answers
428 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 ...
32
votes
30answers
4k 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
331 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 ...
25
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, ...
11
votes
2answers
590 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 ...
51
votes
25answers
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
566 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
259 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
400 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
653 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 ...
19
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
3k 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 ...
53
votes
24answers
10k 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
330 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 ...
2
votes
1answer
359 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
136 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 ...
17
votes
12answers
2k views

I know you, but you don't know me

You're tasked with writing two programs. Program A must print out nothing on all inputs except when program B is input, in which case it should print 1. Program B must print out 1 on all inputs except ...
11
votes
14answers
709 views

Quine…but shifted by one

Referring to the printable ASCII character codes in decimal, we know that from 32 to 126 we have the printable characters with 32 being (space). Your challenge is to write a program using only ...
4
votes
7answers
561 views

Creating a quine in as many characters as possible

A code-bowling is not the same as a code-golf, in a Code-Bowling, you should solve the challenge in as many characters as possible. The goal of this Code-Bowling is to create a quine in as many ...
8
votes
4answers
372 views

Christmas quine!

In the language of your choice, write a program that is arranged in the shape of a Christmas tree that prints itself in the same shape. What is not allowed: Printing out the source file Code that ...
6
votes
7answers
407 views

Write a program to compose a quine of a specified length

Write a program, in a language of your choice, that will compose a quine program of a requested size. The generated program may be in the same or a different language, if desired. Programs are scored ...
25
votes
3answers
910 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 ...
50
votes
30answers
8k views

Print your code backwards - reverse quine

Write a program that prints its own source code out backwards. Scoring: +50 if you use pull data from the Internet. +25 if you read your own source code. +1 point per character Lowest score wins. ...
6
votes
4answers
364 views

Shortest Mirror Quine Challenge

Find the shortest mirror quine in a language of your choice. A mirror quine is a quine whose source code is equal to the reverse of its own source code. Note: 1) Length of source code should be ...
12
votes
1answer
395 views

Golf you a Double Quine for greater good!

Good Evening Ladies and Gentleman. Tonight - we have a code challenge. A competition that will be defined not in the amount of points (a la Asteroids) but simply whether you can finish it (a la ...
22
votes
16answers
1k 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 ...
3
votes
2answers
380 views

Compiled quine variant

Thinking about various quine puzzles here, I got an idea for another one: Compose a program that outputs its own compiled code to a file (or multiple files, if the compiled code is). (This means that ...
8
votes
1answer
290 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 the source file and compute its sum. ...
13
votes
5answers
1k views

Can you Meta Quine?

Similar to other quine puzzles (more specifically, this one), write a program that produces the source for itself. Here's the new twist: The code produced should NOT be identical to the source. ...
16
votes
3answers
718 views

Create a rotating quine

A rotation of a string is made by splitting a string into two pieces and reversing their order, for example "world! Hello," is a rotation of "Hello, world!". It is possible to create programs that can ...
12
votes
2answers
530 views

Write a third order quine

This challenge is an extension of 'Golf a mutual quine'. Using three languages of your choice, create a third order Ouroboros program. That is, in language A, write a program pA which outputs ...
12
votes
9answers
1k views

Interpret your lang, but not yourself?

There are many challenges that say "interpret x", where X is a simple language. In my opinion, that is way top boring. To give all the procrastinating people on the internet something interesting to ...
11
votes
3answers
271 views

Session-Saving Quine

Inspired by this question. Create a program that prompts the user to store some data, and when the program is quitting, spit out the program itself, except the session data changed. The user then ...
0
votes
0answers
147 views

Proving the shortest quine in a particular language [duplicate]

Possible Duplicate: Golf you a quine for great good! People have proposed short quines in various languages. Puzzle: Find the shortest non-trivial quine in a language of your choice, and ...
7
votes
3answers
763 views

Compose a Vim quine! [closed]

Goal: Create and save file in Vim containing at least 25 ASCII characters. The exact keystrokes used during the creation and saving of this file must also produce identical contents in Windows ...
8
votes
7answers
3k views

Write a self-replicating program.

Write a simple program that copies itself when executed. Your program should be some kind of executable file on Windows, Linux, etc.., should generate new executable file, which is identical to your ...
18
votes
11answers
2k views

Golf a mutual quine

Using two languages of your choice, write the smallest “mutual quine” you can. That is, write a program P in language A that outputs the source code for a program Q in language B, such ...
11
votes
5answers
729 views

Code-Golf: 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 ...
10
votes
8answers
2k views

Assembly Language Quine

Write the shortest possible assembly-language quine. Use any ISA you want, unless it has a print-quine instruction or equivalent. Examples include x86, MIPS, SPARC, MMIX, IBM BAL, MIX, VAX, JVM, ...
6
votes
2answers
269 views

Quine that takes as input the name of a language and outputs the same thing implemented in the input language

From Quine central: Write a quine that takes as input the name of a language and outputs the same thing implemented in the input language. The source article has something you can work from, but as ...
40
votes
64answers
6k views

Golf you a quine for great good!

Using your language of choice, golf a quine. No cheating -- that means that you can't just read the source file and print it. Also, in many languages, an empty file is also a quine: that isn't ...