I could not reproduce your crash, in my case it enters an infinite loop
85 86 87 88 89 90 91 92
|
dice[17]++;
for(int k=17;k>0;k--) //checks that none of the values gets to 7
{
if(dice[k]==7)
{
dice[k-1]++;
}
}
|
You increase the last dice, when it reaches 7 you increase the one in position 16.
Analyze what would happen from there.
You've got your array filled with {1,1,1,1,..., 2, 7}
Then you increase the last one so {1,1,1,1,..., 2, 8}
The condition in line 88 would never be true, and you keep increasing the last dice.
If your intention was to reset the last dice to 1, in order to reach all the possible variations, that would take a long time (6**18 > 1e14)
Given that you do not care about the order of the faces in each dice, or the order of the dices, you may optimize the number of sequences to test.
Still it is a big number.(sorry, cannot count it)