3 ms·
Hobby code: I slowly developing a Gin rummy [1] engine. Card sets are represented by 64 bit integers and all operations (findig melds, sets, etc...) are impleme
by szemet 8y ago
Hobby code: I slowly developing a Gin rummy [1] engine. Card sets are represented by 64 bit integers and all operations (findig melds, sets, etc...) are implemented with bitwise operators.
I have used pext/pdep for the iterator implementation (iterate over all subset of a card set, or all combination of n cards).
(e.g. To iterate over all 10 card combination brute-force and filter and print out all the ones which can be knocked (evaluating 15_820_024_220 hands) takes 70 seconds - one threaded - on my 7th gen intel i3.)
[1] https://en.wikipedia.org/wiki/Gin_rummy https://en.wikipedia.org/wiki/Gin_rummy