All 5 card combinations of 7 cards

Hi,

I need to find a loop for the following combinations [indexes]:

0 1 2 3 4
0 1 2 3 5
0 1 2 3 6
0 1 2 4 5
0 1 2 4 6
0 1 2 5 6
0 1 3 4 5
0 1 3 4 6
0 1 3 5 6
0 1 4 5 6
0 2 3 4 5
0 2 3 4 6
0 2 3 5 6
0 2 4 5 6
0 3 4 5 6
1 2 3 4 5
1 2 3 4 6
1 2 3 5 6
1 2 4 5 6
1 3 4 5 6
2 3 4 5 6

Is there a proper way to make a loop or should I write a single one for all 21 ones?
I'm using in to determine the best 5 card poker hand, using a total of 7 cards.
Edit: I'm thinking of using first-fithindex variables and ++ whenever final value is rached.
Also noticed the pattern 0-2,1-3,2-4,3-5,4-6 in each column
Last edited on
Topic archived. No new replies allowed.