Subj : Re: combo numbering To : comp.programming From : Ed Prochak Date : Thu Oct 06 2005 03:12 pm bob@coolgroups.com wrote: > If you have 52 cards and you choose 7, there are 133,784,560 > possibilities. > > So, let's say you have 7 playing cards. Is there an easy way to convert > these cards into a number between 0 and 133,784,559? consider a 52bit number. bit position 0 is ace of spades bit position 1 is duece of spades bit position 2 is 3 of spades ... etc. the 7card hand is a 52bit number with seven 1 bits. You could also use four 13bit numbers , one per suit. that's easily just 4 ints. HTH, ed .