So I am way too lazy to type it again, so have some reading.
Never tell your password to anyone.
Tuesday, November 27, 2012
10:56 PM - Lugnut: I have X dollars and Y cents in change
10:58 PM - Lugnut: I wish to make a script that will take the coins I have, and break them down into all the possible sets of combinations that makes Z$ and uses the most coins
10:58 PM - Lugnut: Sooo, loop through all the coins to divide them up or what
10:59 PM - Lugnut: How would I do that algorithmically
11:00 PM - Jetz: Uses the most coins...? Convert it all to pennies?
11:00 PM - Jetz: I'm not sure I understand the problem
11:04 PM - Lugnut: Say I have 1.25
11:05 PM - Lugnut: And that's 25¢, 4 nickels, 15 pennies, 4 dimes
11:06 PM - Lugnut: Um
11:06 PM - Lugnut: That's only 1$
11:06 PM - Lugnut: Ok yeah its 1$
11:06 PM - Lugnut: Broken down as stated
11:07 PM - Lugnut: I want to calculate how many possible combonations breaks it into 25¢ groups
11:07 PM - Lugnut: 15 pennies + 1 dime
11:07 PM - Lugnut: 5 pennies, 2 dimes
11:07 PM - Lugnut: Etc etc
11:08 PM - Lugnut: With the goal being to break it into the most optimal group for utilizing most of the coins
11:08 PM - Lugnut: ... without turning it into 100 pennies
11:09 PM - Jetz: Wait, break it into groups all using the same set of coins, like you can't use 15 pennies in 1 and 5 in another?
11:09 PM - Lugnut: Create a set of groups, where each group == 25¢
11:09 PM - Lugnut: Where the total is as close to 1$ as possible
11:11 PM - Jetz: And reuse is not aloud between groups? Sheesh that's a difficult problem. Would be annoying to even find a way to brute force that one.
11:11 PM - Lugnut: Correct
11:12 PM - Lugnut: It is allowed between sets
I realized after this line that it would be easier on every party involved's (did I just say
involved's?) brain if I asked the whole of coding help instead.
A good way to think of this is that you have a stuffload of pocket change, and you want to figure out all the ways you want to create bus far.
This is a good comparison cause that's actually what I'm trying to do, lol.
If you have questions or suggestions, please post. You don't need actual code, we're talking algorithms here, not neccesarily code.