Your task is to make a quine, that is a non-empty computer program that prints it's own source without reading it. In addition if you remove any one byte from your original program the new program should print the source of your original program.

This is so answers are scored in bytes with fewer bytes being better.

  • \$\begingroup\$ Related \$\endgroup\$
    – Jo King
    Commented Jul 5, 2018 at 14:41
  • \$\begingroup\$ Also related (duplication instead of deletion) \$\endgroup\$ Commented Jul 5, 2018 at 14:42
  • \$\begingroup\$ Surely this is just an n=1 subset/version of codegolf.stackexchange.com/q/57257/42963 ? \$\endgroup\$ Commented Jul 5, 2018 at 18:25
  • \$\begingroup\$ @AdmBorkBork Any answer there is valid here and vice versa however the scoring is drastically different. This question is straight code-golf and that is a code-challenge. \$\endgroup\$
    – Wheat Wizard
    Commented Jul 5, 2018 at 18:34
  • \$\begingroup\$ @AdmBorkBork, that's the one I was thinking of and assumed was the one Cat was referring to. \$\endgroup\$
    – Shaggy
    Commented Jul 5, 2018 at 19:14

3 Answers 3


Gol><>, 49 45 bytes


Try it online!


I did this in Gol><> rather than ><> because the former has the handy K operator that copies the top n items on the stack, which makes duplicating the clean copy of the source code easier.


This works by having two copies of the executing code, and redirecting to the second one if the first is damaged. This fails when the last \ or the middle newline is removed, both of which are compensated for later.

<<                       Redirect left 
                    <\  Switch to other source code if this line is irradiated
                   "     Push source with wrapping string literal
                ss2      Push quote
              }}         Move "< to end
          q%2l           If the length of the stack is not right
        \`               Push an extra \
       }                 Move the \ to the end
      a                  Newline
    Kl                   Duplicate the stack
   ~                     Pop the extra newline
  H                      Halt and print stack

Vyxal D, 73 51 bytes


Try it Online!

`#Ėß₂:ṘQ,…+ṘẎ7:Ṙq`        # push this string to the stack 
                  Ṙ:      # reverse the string and push a copy 
                    ₂ßĖ   # execute the top if the length is even

# EXECUTION at this point the stack is [ qṘ:7ẎṘ+…,QṘ:₂ßĖ# ]

               Ṙq         # quote and revert => [ `#Ėß₂:ṘQ,…+ṘẎ7:Ṙq` ]
            Ẏ7:           # get the 7 first char => [ `#Ėß₂:ṘQ,…+ṘẎ7:Ṙq` , `#Ėß₂:Ṙ ]
          +Ṙ              # revert and add => [`#Ėß₂:ṘQ,…+ṘẎ7:Ṙq`Ṙ:₂ßĖ#`]
       Q,…                # print, reprint and quit
 #Ėß₂:Ṙ                   # does nothing since the program ended


                       #` # comment

When any char of the string is removed ₂ß prevents the execution

  • if a `` is removed, no code of the line will execute because the line will be either comented, either one single string either a mix of both and no execute fire

  • if is removed, the code will execute normally (as the deletion is not in the string)

  • if any of Ṙ:ßĖ is removed, the code will be either equal to 0, 1, a commented code or there will be no execution. This has no incidence and the code will executein the second line

In any case the first execute will either have the string untouched or a string without incidence, in wich case, the second execute will have the string untouched.

The program ends at the first sucessful execute since there is a quit instruction in the string


Klein 000, 196 190 176 144 138 bytes


Try it online!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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