I am writing a Discord bot for a web-based seventh Sea marketing campaign. Gamers will kind one thing like
roll finesse 4 + weaponry 3 + 1
and the bot will spit out one thing like
Three raises (9+2, 8+3, 6+4, leftover 5)
The onerous half is grouping the cube into raises. I want to do that robotically. Is there a recognized optimum algorithm for this? I performed round with a simple grasping method, however I am not satisfied that it’s optimum in all circumstances. The algorithm I am utilizing now could be:
- Add the most important die.
- Repeatedly add the most important die that won’t make the group exceed 10 (or 15, if relevant).
- If the group is not 10 but, add the smallest die.
I’ve discovered circumstances the place this “virtually” does not produce the optimum consequence, however no precise failures. Nonetheless, I am not fully satisfied. Is there any present analysis on this?