This comes from the same dev known for the 128-language quine relay, where each of the 128 languages prints a program in the next one, looping all the way to the original one. In alphabetical order and as ASCII art, no less.<p><a href="https://github.com/mame/quine-relay">https://github.com/mame/quine-relay</a>
> Prepare a script that deletes one character randomly:<p>Hmm, but can it also deal with general bit flips? Because that's usually what radiation does not delete characters. The only case it would delete a character with a bit flip on the data would be causing the DEL char 0x7F i think, which 7 ASCII chars have a 1 in 8 chance of mutating into (because we have 8 actual bits but only 7 are used for ASCII): ~}{wo_?<p>There are 96 ASCII characters that might be used in source code naively assuming equal character probability that's 7/96 * 1/8 = 0.9% chance of a bit flip deleting a character by mutating into 0x7F. There's also a chance of a character mutating into a non-printable character (0-31), only the 2nd and 3rd column of ASCII can mutate into this by ending up with both high bits off, so there are 64/96 chars with a 1/8 chance that's an 8.3% chance of mutating into a non-printable control char etc (i'm ignoring LF because it displaces DEL). If the 8th bit flips into a one on any char then we get extended ASCII I <i>think</i>, that's 96/96 * 1/8 = 12.5% chance. That leaves 78.3% chance of mutating into another regular printable ASCII character. Apologies for any bad math.<p>There are a lot of possible affects on the interpreter when it sees any of those characters, the control chars could be particularly troublesome.<p>Either way this is still a very cool quine :P
See also the International Obfuscated C Code Contest. [0]<p>This program [1], for example. It just accepts some input on stdin and returns the same input, but mirrored along the diagonal. So the first row of the input becomes the first column of the output, second row becomes second column, etc. But the program is functionally invariant when given itself as input. In other words, you can flip the source code of the program along its diagonal and the result is a program which has the same functionality - it flips stdin.<p>Or this one [2], which parodies java in C. It's functional C code that looks like Java, including the<p><pre><code> class LameJavaApp
{
/** The infamous Long-Winded Signature From Hell. */
public static void main(String[] args)
...
</code></pre>
Or this one [3] that calculates pi by estimating its own surface area.<p>Or this one [4]. It's a lovers quarrel, written simultaneously in C and English. It's incredible, seriously, read it.<p>[0]: <a href="https://www.ioccc.org/" rel="nofollow">https://www.ioccc.org/</a><p>[1]: <a href="https://github.com/ioccc-src/winner/blob/master/1994/schnitzi.c">https://github.com/ioccc-src/winner/blob/master/1994/schnitz...</a><p>[2]: <a href="https://github.com/ioccc-src/winner/blob/master/2005/chia/chia.c">https://github.com/ioccc-src/winner/blob/master/2005/chia/ch...</a><p>[3]: <a href="https://github.com/ioccc-src/winner/blob/master/1988/westley.c">https://github.com/ioccc-src/winner/blob/master/1988/westley...</a><p>[4]: <a href="https://github.com/ioccc-src/winner/blob/master/1990/westley.c">https://github.com/ioccc-src/winner/blob/master/1990/westley...</a>
Someone managed to create a level 3 radiation-hardened quine in Perl (you can remove any 3 characters and it still works):<p><a href="https://codegolf.stackexchange.com/a/100785/98955" rel="nofollow">https://codegolf.stackexchange.com/a/100785/98955</a>
Here is something quite similar I've just made, but in the image domain :<p><a href="https://github.com/unrealwill/uncroppable">https://github.com/unrealwill/uncroppable</a><p>It's a tool POC to steganographically encode an image into itself to make it crop resistant.
The author of this quine (Yusuke Endoh) has a Github repository which encodes a program in the Github contributions graph. I have no idea what the program does but here is a link to the start of it:<p><a href="https://github.com/mame?tab=overview&from=1970-12-01&to=1970-12-31">https://github.com/mame?tab=overview&from=1970-12-01&to=1970...</a>
Any known issues when radiation deleted (instead of altering) any characters? Deleting something is introducing significantly more entropy than altering because it alters the length of the array of text, but altering the array requires recalculating of the rest of the array which is impossible outcome of radiation.
What are the advantages to radiation hardening software? In the cases I've run into the thinking has been "if you can't trust the hardware then you're already lost".
Now can we go further and add self-healing?<p>Include a checksum somewhere. Modify the output or the checksum until they agree.<p>This is starting to sound like how the immune system works actually...