The bithacks was where I found the 14-bit set-bets counting function listed in the OP. It's an excellent page.
I haven't stumbled across the poker page before. Seems like an excellent resource and pretty much exactly something I can use, but sadly I don't have the time to browse it now. It will have to wait till tomorrow
Same is true with your function.
From a quick glance, it seems to follow the same principles as the Kernighan/Ritchie old ANSI C algorithm of counting set bits. I will try it out and check the results vs. a lookup table. Eventually though, I think the table is the way to go to get as much speed out of the code as possible.
Thanks again for all your help.
A fountain of information and great tips
Regards Tom






Reply With Quote