The code for my table generator for 5 card poker evaluation is included. It is a BlitzMax file, which requires the "Cactus Kev's Evaluator" to run. Another evaluator can be used instead with some rewriting of code.

It uses a backtracking depth-first search of the problem space and merges nodes as it finds them, using a binary tree for ordering. This is fast enough for five cards - running the generator takes less than half a minute - and generates an optimal DAG. The resulting tables (after some conversions to 16-bit integers) are here.

Unfortunately, a direct conversion to seven cards using Kev's eval_7hand would take several days to run, so the 7 card problem requires a more messy approach. I'm still working on that code.

Download: gen_eval5.bmx.tar (8 KB)
License: MIT (included)
See also: generated tables