I recently made a variable order rangecoder. It uses the last n bits as context, where n is the order of the model. It then counts the number of one and zero bits after each occurrence of the context and rangecodes the next bit using its calculated probability. The coder outputs 32 bit integers, but I also included code for 8 bit output. It's slow and doesn't have good compression ratios, but I thought that I'd post it anyway for anyone interested.

Also, it seems that CompressionRatings.com can't get it tested due to an error. I can't figure it out, so if anyone has any idea what is going wrong please let me know. Thanks in advance.