unfortunately a full construction is a) so large and b) so slow that I haven't been able to build a full program, but there's a working demonstration of the only non-obvious piece, everything else is straightforward
also I made a few changes to my local copy of the Trianguish interpreter in order to make it a bit more usable when working with larger programs: nethack4.org/pastebin/…; I don't know whether you'd be interested in them or not
I'm not sure if it's so interesting for the answerers, the theoretically optimal strategy is probably either "brute-force digits of pi until you find a particularly compressible string" or just calculating pi from the start
and the former seems incredibly tedious, it's basically the codegolf equivalent of bitcoin mining
but those aren't validity / improvement complaints, more an issue with the concept
but even in terms of getting pi through something like algebraic built-ins
is cos^-1(-1) considered a built-in that calculates pi?
and then is something that calculates n digits of any number allowed? It's not explicitly calculating pi's digits (because i imagine the "no calculating digits" is to stop answers like 100ɾ∆i where ∆i gets the nth digit of pi)
assuming that pi is random, statistically the most-compressible 100-digit substring of the first 10^14 digits of pi probably compresses to 86 or 87 bytes
any, assuming that the compression method doesn't waste encodings
even if the compression method isn't random, we're assuming that pi is, so the probability of hitting an particularly compressible sequence doesn't depend on which sequences it is that are particularly compressible
(in practice, most compression methods do waste encodings on things like headers and checksums. but generally have variants which don't)
get a leading zero after compression and you save a byte
get two leading zeros and you save two bytes, and so on
this is unless the length of the output is implied by the length of the input, in which case obviously it doesn't get any shorter because the particularly-compressed encodings are all being used for shorter strings
now I'm wondering if this is technically a compression algorithm, we call it "compression" but it is different in nature from something like gzip
Your challenge is to print any 100 consecutive digits of π. You must give the index at which that subsequence appears. The 3 is not included.
For example, you could print any of the following:
1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 (i...
Your task is to write a program \$p\$ which outputs a string \$s\$ with the same length as \$p\$, where \$s \neq p\$.
If I remove the \$n\$th byte from your program to get program \$q\$, then either \$q\$ outputs \$s\$ with the \$n\$th byte removed, or it does something else.
Your score is the nu...
normally prints 0.02857142857142857; if any character is removed, it will either print a higher number or crash with an error message containing the number 1
I'm actually pretty sure there's no way to remove a character without causing some kind of error
The aim of this post is to gather all the tips that can often be applied to radiation-hardening challenges.
Please only post answers which can apply to a large number of languages, and one tip per answer.
Output greater than without the previous character
code-golf radiation-hardening
For each character in your program, the program with that character removed must produce a number smaller than the program with the next character removed. Your base program isn't required to do anything.
An example ...
how about this. At step i where i is even your code should have the property that no matter what character you remove the resulting code either crashes/doesn't compile or increase the value of the output.If i is odd it decreases the value of the output
tbf this construction probably isn't worth all 2500 – you could just award 500 on my most recent (on this account)
it is fun to watch, though, using builder snakes to reach points to build things, and building secondary constructors to avoid a slowdown
but the secondary constructors are easier to build than I anticipated because you don't have to build the logic that determines whta to build, you can just leave that in its original location and send the instructions along a wire
so it was only about 3 days' worth of work rather than the weeks it looked like it coudl take
@Adám believe it or not this is actually a Jelly builtin. although I needed to add a second builtin to get the output format to match
by the way, I'm pretty sure self-replicating programs do exist in Trianguish, for much the same reason that TC languages generally have quines, but they'd almost certainly be too large to run in the JS interpreter