mlang/poker.el — pull request #2 by juergenhoetzel (2014-05-15 20:34:48+00:00)
Title: fix invalid implementation of `poker-possible-hands'

Use generic `poker-combinations' as helper function.
The previous defination returned each 5 card combination of 7 cards twice:

ELISP> (length (poker-possible-hands '(1 2 3 4 5 6 7)))
42
ELISP> (length (delete-dups (poker-possible-hands '(1 2 3 4 5 6 7))))
21

Also the new implementations is a little bit faster. Old:

ELISP> (benchmark 100000 '(poker-possible-hands '(1 2 3 4 5 6 7)))
"Elapsed time: 44.918057s (17.714416s in 209 GCs)"

New:

ELISP> (benchmark 100000 '(poker-possible-hands '(1 2 3 4 5 6 7)))
"Elapsed time: 22.029148s (8.856341s in 98 GCs)"