A radiation-hardened quine can take a hit and stay standing, but nobody ever said that the quine can't be a wuss about it.

For this challenge, you should write a quine that:

  • If no characters are removed, prints its source code normally.
  • Iff any one character is removed, prints the original program's source code, followed by a new line and then this text:

    Owie! That hurt!

    You should only print the original plus that.

Standard quine rules apply for this challenge, and the shortest valid code in bytes wins. See also Radiation Detector!

  • 2
    \$\begingroup\$ I'm not sure what this adds to the site beyond the quine and radiation hardened quine challenges. \$\endgroup\$ – Gabriel Mills Feb 8 at 2:29
  • 2
    \$\begingroup\$ There's a little bit of new complexity in both retaining the same behaviour while irradiated, while also being able to tell that it has been irradiated. \$\endgroup\$ – Jo King Feb 8 at 12:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.