I have searched all over and can't find examples of the code I'm looking for. I need to evaluate a combination or values in an array one at a time. Here is what would happen. I'll use coins for the example to make it easy to understand
user inputs that they have 5 coins.
so the first array would be:
(5,0,0,0) !the array being (quarters, nickels, dimes, pennies)
then run a sub to check the value of the array which would be $1.25, that part I dont need help with, just the code to find the combinations of the array.
the next array would just check the next combination and check again, but the next few examples of arrays would be:
(4,1,0,0)
(4,0,1,0)
(4,0,0,1)
(3,2,0,0)
(3,1,1,0)
(3,1,0,1)
(3,0,1,1)
(3,0,0,2)
(2,3,0,0)
(2,2,1,0)
(2,2,0,1)
(2,1,2,0)
(2,1,1,1)
(2,1,0,2)
(2,0,3,0)
(2,0,2,1)
(2,0,1,2)
(2,0,0,3)
and so forth until you got to (0,0,0,5)
Any help would be greatly appreciated!!!!!
user inputs that they have 5 coins.
so the first array would be:
(5,0,0,0) !the array being (quarters, nickels, dimes, pennies)
then run a sub to check the value of the array which would be $1.25, that part I dont need help with, just the code to find the combinations of the array.
the next array would just check the next combination and check again, but the next few examples of arrays would be:
(4,1,0,0)
(4,0,1,0)
(4,0,0,1)
(3,2,0,0)
(3,1,1,0)
(3,1,0,1)
(3,0,1,1)
(3,0,0,2)
(2,3,0,0)
(2,2,1,0)
(2,2,0,1)
(2,1,2,0)
(2,1,1,1)
(2,1,0,2)
(2,0,3,0)
(2,0,2,1)
(2,0,1,2)
(2,0,0,3)
and so forth until you got to (0,0,0,5)
Any help would be greatly appreciated!!!!!