Skip to main content
Commonmark migration
Source Link

#Perl, 1116 1124 bytes, n=3, score=1124^(2/3) or approximately 108.1

Perl, 1116 1124 bytes, n=3, score=1124^(2/3) or approximately 108.1

#Perl, 1116 1124 bytes, n=3, score=1124^(2/3) or approximately 108.1

Perl, 1116 1124 bytes, n=3, score=1124^(2/3) or approximately 108.1

Bounty Ended with 500 reputation awarded by Martin Ender
post the verification script
Source Link
user62131
user62131

Verification script

Not very pretty, but posting it because someone asked. I ran this several times with a variety of settings (typically changing $min and $max to check for various areas of interest); it wasn't a fully automated process. It has a tendency to stop running due to heavy CPU load elsewhere; when this happened, I just changed $min to the first value of $x that wasn't fully checked and continued running the script (thus ensuring that all the programs in the range got checked eventually). I only checked deletions from the first copy of the program, because it's fairly obvious that deletions from the other copies can't do more.

use 5.010;
use IPC::Run qw/run/;
undef $/;
my $program = <>;
my $min = 1;
my $max = (length $program) / 4 - 3;
for my $x ($min .. $max) {
    for my $y ($x .. $max) {
        for my $z ($y .. $max) {
            print "$x, $y, $z\n";
            my $p = $program;
            substr $p, $x, 1, "";
            substr $p, $y, 1, "";
            substr $p, $z, 1, "";
            alarm 4;
            run [$^X, '-M5.010'], '<', \$p, '>', \my $out, '2>', \my $err;
            if ($out ne $program) {
                print "Failed deleting at $x, $y, $z\n";
                print "Output: {{{\n$out}}}\n";
                exit;
            }
        }
    }
}
    
say "All OK!";

Verification script

Not very pretty, but posting it because someone asked. I ran this several times with a variety of settings (typically changing $min and $max to check for various areas of interest); it wasn't a fully automated process. It has a tendency to stop running due to heavy CPU load elsewhere; when this happened, I just changed $min to the first value of $x that wasn't fully checked and continued running the script (thus ensuring that all the programs in the range got checked eventually). I only checked deletions from the first copy of the program, because it's fairly obvious that deletions from the other copies can't do more.

use 5.010;
use IPC::Run qw/run/;
undef $/;
my $program = <>;
my $min = 1;
my $max = (length $program) / 4 - 3;
for my $x ($min .. $max) {
    for my $y ($x .. $max) {
        for my $z ($y .. $max) {
            print "$x, $y, $z\n";
            my $p = $program;
            substr $p, $x, 1, "";
            substr $p, $y, 1, "";
            substr $p, $z, 1, "";
            alarm 4;
            run [$^X, '-M5.010'], '<', \$p, '>', \my $out, '2>', \my $err;
            if ($out ne $program) {
                print "Failed deleting at $x, $y, $z\n";
                print "Output: {{{\n$out}}}\n";
                exit;
            }
        }
    }
}
    
say "All OK!";
finally verified as correct
Source Link
user62131
user62131

Update: I've now verified that this works with n=2n=3 via brute force. Currently running a brute-forcer (with some optimizations to avoid obviously useless deletionswhich took a couple of days) for the n=3 case, because; with a program this complex, it's hard to check for radiation-resistance by hand; it's going to take a while, though, and I thought I'd start writing up this explanation while waiting for it to run. I've already verified that the outside wrapperhand (the section of the program with the most constraints on its operation) functions with any three characters deleted; thus if there is some combination of charactersand I haven't thought of that breaks itmade one mistake in a previous version, it's probably going to be easily fixablewhich is why the byte count increased). End update

I've verified that this works with n=2 via brute force. Currently running a brute-forcer (with some optimizations to avoid obviously useless deletions) for the n=3 case, because with a program this complex, it's hard to check for radiation-resistance by hand; it's going to take a while, though, and I thought I'd start writing up this explanation while waiting for it to run. I've already verified that the outside wrapper (the section of the program with the most constraints on its operation) functions with any three characters deleted; thus if there is some combination of characters I haven't thought of that breaks it, it's probably going to be easily fixable.

Update: I've now verified that this works with n=3 via brute force (which took a couple of days); with a program this complex, it's hard to check for radiation-resistance by hand (and I made one mistake in a previous version, which is why the byte count increased). End update

My bruteforcer found a mistake; fix it
Source Link
user62131
user62131
Loading
copyedit; wow were there a lot of typos/thinkos here
Source Link
user62131
user62131
Loading
brute-forcer says that damage to only the decoding table doesn't break the quine; that's what I was most worried about, so it's almost certainly valid now
Source Link
user62131
user62131
Loading
Source Link
user62131
user62131
Loading