jim, you dont have to say i = 0 to 9, 0 to 8 will get the job done. 0 to 9 is NINE numbers. But your code is perfect.
also, the for loop that increments the states needs to be:
because then it will go from j to 0 and not from j to 1.Code:for(i=j;i>-1;i--) state[i]++;
Have fun coding...




:MoMad:
Reply With Quote