| | Again I've faced up with a problem... I'm writing a simple AI for a bot, but it still works in a slow way :*( So, the thing I'mma ask you, dear programmers, is that one: We've got a set of actions that can be done(n). Each action requires a certain amount of ActionPoints(AP) Bot has an unknown amount of ap(m) So, we must find Number of possible combinations, given total number of AP, array of actions and their costs. As you might understand, I need the formula. Don't suggest any ways to find the combinations themselves - this is already done by me, that formula would a great deal accelerate the process. |

