The Setup
Here you can find the full text of The Tragedy of Macbeth. If you view the source, and save it as text, you will notice it comes out to 206,244 total characters (including the whitespace at the end of the html).
The Challenge
Write a program which compresses the text linked above into the smallest possible text file which can then reproduce the original text exactly (including the whitespace).
The Rules
Your program cannot have any prior knowledge of the text it is compressing. The goal however is still to compress this specific text, so don't worry if it sucks at other text as long as it does the best job possible on Macbeth.
The program must take either "compress" or "decompress" as the first parameter and the text file as the second command line parameter. The compressed output has to be a text file, and it has to be UTF16. The compressed output when decompressed must match exactly the original file in a character for character comparison.
The program needs to finish in a reasonable amount of time. If it takes longer than a few seconds, please list the average running time with your submission.
The Scoring
The only score is the number of characters in the compressed output. The score only counts if the decompress matches the original in a character for character comparison.
The compressed output has to be a text file, and it has to be UTF16., why? also, does that mean that the output must only contain valid UTF16 codepoints? – Hasturkun Feb 8 '11 at 15:07