I'm not a very experienced in TI-BASIC (~6 days of experience), and I was wondering what the fastest way is to take a list of numbers representing dice (each number represents the number of sides on each die), and return a list; each item on the returned list would be equal to how many times the sum of the rolled dice was the index of that item, taking into account every possible combination of die rolls.
Here's an example:
Code:
would result in
Code:
Out of the 96(4*4*6) possible combinations, 1 added up to 3, 3 added up to 4, 6 added up to 5, etc.
I have a program that works, but it is very slow. if you enter just 2d100, it will take a VERY long time to finish, as it has to go through my recursion loop a little over 10,000 times.
Here's an example:
Code:
{4,4,6}
Code:
{0,0,1,3,6,10,13,15,15,13,10,6,3,1}
Out of the 96(4*4*6) possible combinations, 1 added up to 3, 3 added up to 4, 6 added up to 5, etc.
I have a program that works, but it is very slow. if you enter just 2d100, it will take a VERY long time to finish, as it has to go through my recursion loop a little over 10,000 times.