The rules of the game are quite simple, and here I will exhaustively
explain them to the best of my ability.

As you probably know, the game involves two dice and a wooden box
constructed with shutters or sliders that can be moved to reveal
or conceal each of the numerals from one to nine.

The player begins by rolling the two dice. The sum of the dice
becomes the target value for that particular round. For example,
if the dice are as they look below, the target value for that round
is eight.

The player then proceeds to close any number of sliders such that
the final sum of the sliders that have been shut during that particular
round is exactly equal to the target. In the instance above,
a player could close sliders 8; 1 & 7; 1,2 & 5; 1,3 & 4; 2 & 6; or 3
& 5 since 8 = 8 = 1 + 7 = 1 + 2 + 5 = 1 + 3 + 4 = 2 + 6 = 3 + 5.

Before the player arrives at the target sum, the player has the option
to "take back" their last move. Continuing with our example, if
the target is eight and the player starts by shutting the 2, and then
decides that shutting the 3 and 5 would be a better play, then the
player is allowed to open the 2 and shut the 3 and 5, provided that
the player has not yet shut the 6 (as 2 + 6 = 8, the target).

Once a slider is shut, it stays shut for the whole game. Shut-the-Box
does not involve subtraction from a slider total (though such a rule
could add another level of complexity to the game).

As the game reaches its completion, their exists another possible
situation. For example, if a player successfully closes every number
save 5 (that is, if 5 is the only number still open), the subsequent
roll will be of a single die (die = singular of dice). The reason
for this is straight-forward. If the total of open numbers is six or
less, the probability of rolling that total increases if the player
rolls only one die. For instance, the odds of rolling a 5 on two
dice are 1/9 or roughly 11% (meaning with two dice, you will roll 5
11% of the time). Using one die, the odds of rolling a 5 are 1/6 or
roughly 16.6% (meaning you roll 5 16.6% of the time). In some versions
of the rules, players are allowed to decide if they would rather roll
1 or 2 dice if the remaining total is 6 or less; however, it is
always better to roll one die, so that is how I've implemented
the rules.

Play continues until all of the sliders are shut or until an
impossible roll occurs. If all of the sliders are shut, the player
cries out "ShutBox!" indicating that the player has accomplished the
goal of the game, and in a multi-player situation, is likely to be
the winner. An impossible roll occurs if the sum of the dice cannot
be "shut out" by closing sliders. As mentioned before, the sum of
the sliders shut must exactly equal the target sum. If this
is not possible given the remaining open numbers, then the game ends.

Again, if one rolls an eight, but only the five is left open, the game
is over and the score is 5. It would be impossible to close off the
remaining open sliders to equal the target number in this case.
Though the player in this case may be dissapointed that ShutBox was
not accomplisher, 5 is a pretty good score. In the worst case scenario,
a player could roll "snake eyes" (double ones, or sum of two) twice
in a row. Since the two would have been closed on the first roll,
on the second roll of 2, the game would end, leaving the player with
a score of 1 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 43. This scenario happens
1 of 1296 games or 0.077% of the time.