Skip to content

wdi-hk-9/Shut-The-Box

Repository files navigation

WDI HK 9 Project 1

Shut The Box

Rules

At the start of the game all levers or tiles are "open" (cleared, up), showing the numerals 1 to 9.

During the game, each player plays in turn. A player begins his or her turn by throwing or rolling two dice into the box.

After throwing, the player adds up the dots (pips) on the dice and then "shuts" (closes, covers) one of any combination of open numbers that equals the total number of dots showing on the dice. For example, if the total number of dots is 8, the player may choose any of the following sets of numbers (as long as all of the numbers in the set are available to be covered):

  • 8
  • 7, 1
  • 6, 2
  • 5, 3
  • 5, 2, 1
  • 4, 3, 1

The player then rolls the dice again, aiming to shut more numbers. The player continues throwing the dice and shutting numbers until reaching a point at which, given the results produced by the dice, the player cannot shut any more numbers. At that point, the player scores the sum of the numbers that are still uncovered. For example, if the numbers 2, 3, and 5 are still open when the player throws a one, the player's score is 10 (2 + 3 + 5 = 10). Play then passes to the next player.

After every player has taken a turn, the player with the lowest score wins.

If a player succeeds in closing all of the numbers, he or she is said to have "Shut the Box” the player wins immediately and the game is over.