Regarding the proposed Binray Literals Deprecation

Steven Schveighoffer schveiguy at gmail.com
Wed Sep 14 14:33:11 UTC 2022


On 9/14/22 4:43 AM, Patrick Schluter wrote:

> 
> `core.bitop.popcnt(check) == 4` would be simpler and most modern CPU's 
> have an instruction for that.

I do use that for flushes! 
https://github.com/schveiguy/poker/blob/6f70cf7ca74e19e78b470f81640a3ce34a95d0d3/source/poker/hand.d#L376-L386

And a cool thing about that too, the "best" flush is simply the mask 
that is larger (because it has higher bits set, i.e. bigger rank cards).

Man, that was a fun little project ;)

-Steve


More information about the Digitalmars-d mailing list