| ▲ | im3w1l 2 hours ago | |
Representation for this I came up with: Allocate one magic number for "start line with space" another for "start line with asterisk" then any other number means this many of the current character and then swap character. Then it's a matter of picking a suitable way to encode numbers into bits. I came up with groups of four bits. If the high bit is not set that is the number, if it is set then read an additional group of four bits, and interpret as a biased 7 bit number. This came out to 400 bytes not including decompressor. | ||
| ▲ | urbnspacecowboy an hour ago | parent [-] | |
> Allocate one magic number for "start line with space" another for "start line with asterisk" then any other number means this many of the current character and then swap character. The galaxy brain move would be to always arbitrarily start with one character, replace the two special numbers with a single "don't output any characters, just swap" number, and then... congratulations, you just reinvented CompuServe RLE! http://fileformats.archiveteam.org/index.php?title=CompuServ... | ||