Reading last years entries, this image decompression oneliner outputs its own logo when passed the hash of its source code?! Pretty neat.
Reading last years entries, this image decompression oneliner outputs its own logo when passed the hash of its source code?! Pretty neat.
"While terseness was preferred over obscurity, this program hopefully still lives down to IOCCC’s usual standards of clarity."
“Several variants of this program were considered. Several.”
(They must have tried billions of variants to find the match on md5sum. Luckily, you don’t have to compile or run the code to find that match)
> By an astonishing coincidence, the number of bits in the input format is approximately the log2 of the number of MD5 evaluations that a five-year-old GPU can do in an hour.
> There are no magic numbers in the program, and bits of the input map to pixels of the output in a regular way, yet it outputs a nice icon for itself, if given the MD5 hash of its own source. How?
I'm assuming the fact that MD5 is completely broken plays into it somehow...
I read this to mean he calculated a matching hash on his GPU, in order to tune the magic constants of his app to produce the desired output.
> There are no magic numbers in the program
There are several:
long z,x,G;main(){for(puts("P1\n80 80"),scanf("%10lx",&G);3-z/2160;x=++z%81/8-5)putchar(5>x?!(16>>(x^-(x<1))+1&G<<5>>z/648*5)^49:10);}Changing any of the other numbers would surely impact the function of the program, I don't think you could get to a 40 bit brute-force there.
I think the brute-force was done by making non-semantic changes like variable names and changing the order of the declarations.
Yep. You have 17 bits of entropy just in the names of three single-letter variables.
This is right there in the mad scientist territory.
Incredible, pure bananas.