in reply to Re: creating crystal ball
in thread creating crystal ball

... and while reading it, I couldn't help thinking about LZW compression. I'm not sure if you're familiar with it or not, but I think you could adapt it to your problem

Funnily, the original post was making me think about Prediction by Partial Matching compression!