Join Date: Feb 2006
Posts: 24,647
It would be pretty trivial to write one, I think. The hand space is so small that you should actually just make a static lookup table. There are only C(52, 4) possible hand combinations (270,725). That's small enough that I would just keep it at that. If you need to compress space further at the expense of time then you could put the hands into a canonical format - Ac 2s 3d 4h is the same score as As 2d 3c 4h and so forth. You can use a 32 bit integer as the score, so it would barely be a megabyte.