You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented a poker calculator many years ago, here are some things that I learned.
You can get excellent performance by representing cards as bits. A hand can be composed of 4 u13, each one representing one suit. Bit 0 represents card 2 and bit 12 represents an Ace. Testing for a flush can be done by checking if the pop count of a suit is at least 5. Testing for a straight can be done by or’ing all suits and checking if the set bits are contiguous. Checking for a pair can be done by and’ing each pair of suits and checking if any of these is different from 0
An alternate implementation to either add or replace the current one
LucasSantos91:
https://ziggit.dev/t/zigpokerhands/3551
The text was updated successfully, but these errors were encountered: