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 (add bonuses/penatly percentages together for total percentage):

  • Answers must be at least 4 characters long
  • Program must contain at least one alphabetical character in its source, so for example, 12345!@#$%^&*() is disqualified
  • +750% if the language used is not Turing-complete (I'm looking at you, HTML!)
  • -15% if the solution does not read its source from anywhere in any form
  • -20% if you can also keep only every 5th character and still form a quine

The score is measured by the number of characters in the first program.

Example (not real programs):

If 123456789abcdef and 13579bdf are both quines, the score is 15. Additionally, if 159d is also a quine, then the final score is 12.

This is code-golf, so lowest score wins.

  • 2
    \$\begingroup\$ @hosch250 The original program wouldn't be a quine because it wouldn't print those whitespaces. Same goes for unnecessary comments. \$\endgroup\$ – Jwosty Mar 7 '14 at 5:26
  • 1
    \$\begingroup\$ Yeah, I have never programed a quine before, and have no idea how to do it without reading the source code in C++. I have seen them in C++ before though! \$\endgroup\$ – user10766 Mar 7 '14 at 5:37
  • 1
    \$\begingroup\$ You state: "-20% if you can also remove every 4 characters and still form a quine". But technically this is not what happens in your example. You mean you can do it a second time? \$\endgroup\$ – mmumboss Mar 7 '14 at 8:17
  • 4
    \$\begingroup\$ Are the bonuses additive or multiplicative? That is, if my program is 10 chars long and qualifies for both the -15% bonus and the -20% bonus, will its score be 10 * (1 - 0.15 - 0.2) = 6.5 or 10 * (1 - 0.15) * (1 - 0.2) = 6.8? I assumed the latter, but an explicit clarification would be nice. \$\endgroup\$ – Ilmari Karonen Mar 7 '14 at 10:26
  • 1
    \$\begingroup\$ Wouldn't this be a Mandoline quine, not a Guillotine? Guillotines make one clean, generally fatal, cut and the head rolls away. Mandolines make with the many evenly spaced slices. :) \$\endgroup\$ – Jonathan Van Matre Mar 7 '14 at 21:45

10 Answers 10


PHP, 4 chars − 15% − 20% = 2.72 2.6 points


Yes, PHP is a Turing-complete language. Nobody said I have to use any of its actual programming features. ;-)

Edit: Changed the score based on the clarification that bonuses are additive, not multiplicative.

  • \$\begingroup\$ This works in ASP, possibly. \$\endgroup\$ – Ismael Miguel Mar 7 '14 at 14:03
  • 2
    \$\begingroup\$ @n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ I give up. :P \$\endgroup\$ – Jwosty Mar 8 '14 at 4:35
  • 18
    \$\begingroup\$ Actually, use of PHP's actual programming features is discouraged. \$\endgroup\$ – Rhymoid Mar 8 '14 at 18:21
  • 1
    \$\begingroup\$ This is not a proper quine. Still a good answer, though \$\endgroup\$ – MilkyWay90 Apr 6 '19 at 18:21

TI BASIC 4 - 35% = 2.6

I might understand them wrong, but I think I am also eligible for the -15% and the -20% bonusses, meaning I have the lowest possible score.

I can write the program:


which will output 123i where i is of course the imaginary unit. When you remove the 1st and the 3rd character all that remains is 2i which outputs 2i

  • \$\begingroup\$ Not quite... '12i' will output '12i' and '2' will output '2' for a minimum score of 1.95. \$\endgroup\$ – intx13 Mar 7 '14 at 11:33
  • \$\begingroup\$ Actually, '2i' scores 1.3, and if the empty program is considered a quine, 'i' scores 0.65. \$\endgroup\$ – intx13 Mar 7 '14 at 11:36
  • 4
    \$\begingroup\$ @intx13: "Answers must be at least 4 characters long." \$\endgroup\$ – Ilmari Karonen Mar 7 '14 at 14:02
  • \$\begingroup\$ Ah, I missed that! \$\endgroup\$ – intx13 Mar 7 '14 at 18:14
  • \$\begingroup\$ Beat me to it ;) \$\endgroup\$ – Timtech Mar 8 '14 at 0:40

Python - 95

Great challenge. I thought this was pretty clever, and actually a legit solution!

  • 1
    \$\begingroup\$ Nice! Note this technically doesn't work as-is since you end up deleting the newline when making the alternate quine. requires a tad bit of tweaking IOW \$\endgroup\$ – Claudiu Mar 7 '14 at 5:44
  • 3
    \$\begingroup\$ @Claudiu Well I guess it depends on whether OP considers newline a character. If so, you can just add a newline between each line. 96 chars \$\endgroup\$ – qwr Mar 7 '14 at 5:47
  • \$\begingroup\$ Of course a newline is a character... \$\endgroup\$ – mbomb007 Dec 13 '16 at 21:28

Golfscript, 5 points


is a function that, when executed, will run the (non-existing) function hai. It's not executed, however, but rather printed when the program ends - including the outer brackets. Removing each other character yields:


Lame, I know :-)

  • \$\begingroup\$ I believe you qualify for both bonuses, too: your program does not read its own source code, and {} is a quine too. \$\endgroup\$ – Ilmari Karonen Mar 7 '14 at 10:21
  • \$\begingroup\$ @IlmariKaronen it's hard to tell what counts as reading own source code. Does unevaluating functions count? Does evaluating strings count? As for the other bonus - maybe it's just badly worded, but I read "remove every four characters" as "keep every fifth character", which would leave me with one bracket only (though {ab0} qualifies if 0 can be the one that's kept) \$\endgroup\$ – John Dvorak Mar 7 '14 at 10:40
  • \$\begingroup\$ It's indeed badly worded, but the example suggests it means "keep every fourth character". Anyway, as you note, {ab0} qualifies either way. \$\endgroup\$ – Ilmari Karonen Mar 7 '14 at 10:44
  • \$\begingroup\$ It seems {hi} also works, will be shorter (4 chars), and will also qualify for all bonuses. (Seems the script {i evaluates to {i for some reason...) \$\endgroup\$ – Claudiu Mar 7 '14 at 16:59
  • \$\begingroup\$ @Claudiu {i produces an extra closing curly for me \$\endgroup\$ – John Dvorak Mar 7 '14 at 19:02

HQ9+ - 4 * 7.5 * 0.8 = 24 points


Still a quine with every second character:


...and every fifth:


Sorry, I couldn't resist. :)


HTML/Markdown, 4*7.5 = 30


I admit this is lame, but it doesn't really go against any rule in the question. Except that HTML/Markdown may not be considered a real programming language.

  • \$\begingroup\$ I suppose I didn't specify that programs that can't be split any smaller aren't valid. Revising challenge... \$\endgroup\$ – Jwosty Mar 7 '14 at 5:38
  • \$\begingroup\$ @Jwosty: then "HHHH" in HTML would win. Note 5555 doesn't work because it has no alphabetic character \$\endgroup\$ – Claudiu Mar 7 '14 at 5:42
  • \$\begingroup\$ You need an alphabetic character. \$\endgroup\$ – qwr Mar 7 '14 at 5:43
  • \$\begingroup\$ @qwr: Forgot that when looking at GolfScript. Removed. \$\endgroup\$ – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ Mar 7 '14 at 5:44
  • \$\begingroup\$ Hmm... I suppose that this valid :P \$\endgroup\$ – Jwosty Mar 7 '14 at 5:50


I liked qwr's solution so much, I shamelessly made a port for POSIX shell. Please don't save it into a filename containing spaces.

: '#';cat $0

#c a t   $ 0

Start removing at character number 1, and count newlines as characters. The second quine is of course:

 #;a 0
cat $0

Please upvote qwr's answer instead of this one!


Bash, 23

Newline is a character!

Some messy comment work, so that when every other character starting from the first is removed, the comment becomes code and the code becomes a comment:

#cRaRtR R$R0R R#
cat $0

After every other character (including the new line) is removed:

cat $0 #ct$
  • \$\begingroup\$ it's not a quine if it reads its own source though. \$\endgroup\$ – daniero Apr 13 '14 at 14:58
  • \$\begingroup\$ @daniero "-15% if the solution does not read its source from anywhere in any form" implies that you are allowed to read the program's source (but you don't get the bonus) \$\endgroup\$ – user16402 Apr 13 '14 at 15:39
  • \$\begingroup\$ @daniero oh i looked on wikipedia I suppose it is cheating... but it's code-golf \$\endgroup\$ – user16402 Apr 13 '14 at 15:44
  • \$\begingroup\$ I always upvote cats! \$\endgroup\$ – Antonio Ragagnin Apr 13 '14 at 18:29

Brainf**k, 37 - 15% = 31.45

Abusing the Portable Brainfuck Interpreter


Start removing from the second character.

  • \$\begingroup\$ When i run this I get B-C<D+E]F-GÿH<I<J<K<L<M<N<O[P.Q>R] as output so it's lacknig some characters. \$\endgroup\$ – Sylwester Mar 8 '14 at 10:57
  • \$\begingroup\$ Is it Brainfuck, or a particular dialect of Brainfuck that only works on one interpreter? \$\endgroup\$ – user253751 Mar 8 '14 at 10:57
  • \$\begingroup\$ @immibis It's regular (those capital letters can be spaces or symbols or anything). However, you must use the portable interpreter linked from the answer. \$\endgroup\$ – Timtech Mar 8 '14 at 12:28
  • 1
    \$\begingroup\$ The first part goes left until it finds the ÿ and the linked interpreter happens to store the code 5000 bytes before the start of the data tape. That's hardly portable Brainfuck. \$\endgroup\$ – user253751 Mar 8 '14 at 12:40

HQ9+T, - 4 * 0.8 = 3.2 points


It's a valid quine (ish) and a quine every second and fifth char. I couldn't resist . . . .


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.