RUN-LENTH CODING ---------------------- Compilation instructions: -------------------------------------------------------------------------------- No special instructions. Compile rle.c and drle.c for an encoder, and decoder, respectively. -------------------------------------------------------------------------------- The encoder is a very basic run-length encoder that encodes repetitive sequences by printing a control character, -- #defined to be ASCII number 0 -- the character to print, followed by the number of times to print it. A non character ASCII code is used as the control character to avoid instances where the control character appears in the input, which would seriously confuse the decoder. For this reason, the encoder will only function properly on inputs which are ASCII text files, which is rather amusing, since normal text files will hardly be compressed at all due to their lack of repeating sequences. The encoder only encodes sequences of 4 or more characters. Since a code requires 3 bytes, encoding sequences shorter than 4 would either result in no net reduction, or an increase in file size.