![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I run into wacky math things while I play my pointless games.
The setup:
I have a set of monsters I can use. They each cost a certain, different, amount of creds to play. I have a maximum amount of creds I can spend. The order of monsters I play is relevant.
What is the formula for determining all the possible permutations?
Don't tell me there isn't one, there must be one.
The setup:
I have a set of monsters I can use. They each cost a certain, different, amount of creds to play. I have a maximum amount of creds I can spend. The order of monsters I play is relevant.
What is the formula for determining all the possible permutations?
Don't tell me there isn't one, there must be one.
(no subject)
Date: 2017-05-28 02:10 am (UTC)Monster A costs 1 credit
Monster B costs 2 credits
Monster C costs 3 credits
Monster D costs 3 credits
and you have seven credits and want to know all the possible ways to spend them?
(no subject)
Date: 2017-05-28 02:00 pm (UTC)Generating all of them should boil down to looping through the set of monsters, stick it in the "list of monsters used so far" list, then pass that list and the set with the monster removed recursively done until either "all onsters used" or "funds used up".
(no subject)
Date: 2017-05-28 04:09 pm (UTC)