I want to create random tables for roleplaying games. I have N items I want to go on the random table, and there are M optional items that could also go on that table. What are all the possible rolling schemes, using standard RPG dice, that could cover all the required items on the table, using the optional items to pad the table?
My solution is a breadth-first search which prints out possible dice schemes. You could modify it to return the schemes instead of printing them. There are constraints you can change at the top of the file.
Run this way: