Re:A bootable CD image with a retro game in a single tweet
by makomk on Tuesday July 31, 2018 @05:55PM
(#17657579)
It's pretty light compression from what I can tell - basically just squashing down runs of nulls to a single count.
[ Parent
| on HN ]
Re:A bootable CD image with a retro game in a single tweet
by wtmcc on Tuesday July 31, 2018 @06:39PM
(#17657918)
The compression is basic run-length encoding, leveraging the Perl repetition operator (x), and the property of the Perl print/say functions that they concat items passed in a list before writing to STDOUT.
https://en.wikipedia.org/wiki/Run-length_encoding
https://perldoc.perl.org/perlop.html#Multiplicative-Operator...
Re:A bootable CD image with a retro game in a single tweet
by lucb1e on Wednesday August 01, 2018 @11:18PM
(#17669020)
I tried xz -9 on it and found, to my surprise, that it was actually longer than RLE!
Then I tried gzip -9, because perhaps that has a smaller header? Yup, saved a few bytes, now it's about the same size. Finally, I remembered that bzip2 does a lot better on text than gzip, and who knows, it might also have a shorter header than xz. Again, a few more bytes saved! Down to 223, where the original is 249 bytes (including the 'say' part but excluding the unnecessary delimiting apostrophes or the rest of the command).