<![CDATA[Shut the Box Maths]]> false false false false false false false true true false ]]> ./shuttheboxfrem/Screen Shot 2018-05-07 at 1.14.25 PM (2).png ./01authorlookang50x50.png; DESCRIPTION_EDITOR Intro Page true false _default_ Intro Page false

https://nrich.maths.org/6074

To play the game, start with the numbers showing on all the cards. The first player rolls the two dice. They can turn over the cards which are the same as the numbers rolled. For example, if a 4 and a 5 is rolled, they would turn over the 4 and 5 cards. If a double is thrown, the player's turn ends. They can roll the dice again until they can't turn over any more cards.

The cards that are left showing are then added and that is their score. The dice are then passed to the next player who turns the cards the right way up again and then rolls the dice in the same way as player one. They now can keep on rolling dice as long as each time they can turn over some new cards. Remember that if a double is thrown, the player's turn ends.

When the player can't turn over any more cards, those that are left are added together and that is the player's score. The winner is the person with the lower score. It can be played with just one turn each or each player can have a number of turns that you decide at the beginning of the game.

]]>
DESCRIPTION_EDITOR Game Modes true false _default_ Game Modes false
  • Modes from  Wikipedia https://en.wikipedia.org/wiki/Shut_the_Box
  • Golf – A player's score is the sum of the numbers remaining uncovered at the end of his turn. The player with the lowest score wins.
  • Missionary – A player's score is the total number (count) of the tiles remaining uncovered at the end of his turn. For example, a player scores 3 if at the end of his turn 3 tiles remain open. The player with the lowest score wins.
  • Unlucky number 7 – A standard game, when a 7 is rolled, the game stops.
  • 3 down extreme – numbers 1, 2 and 3 are pre dropped, leaving numbers 4 to 9 up.
  • Lucky number 7 – The only number up is 7, and the first person to roll a 7 wins.
  • Unlucky number 7 – A standard game, when a 7 is rolled, the game stops.
  • Against all odds – All odd numbers are up and evens down.
  • Even Stevens – All even numbers are up and odds down.
  • Thai style (Jackpot) – Always roll two dice, but only cover one tile matching one of the dice or their sum. For example, if the dice show a 2 and a 3 you may cover one of 2, 3, or 5.
  • Digital – A player's score at the end of the turn is the number obtained by reading the up digits as a decimal number from left to right. For example, if 1, 2, and 5 are left up the score is 125.
  • 2012 – All 12 are up, but use a 20-sided Dungeons and Dragons die rather than the pair of 6 dice: 20-sided die playing 12 numbers – 2012. This may seem a little geeky, but it adds a new level of excitement to a tired game.

]]>
20 1 true VARIABLE_EDITOR varfrem true false VARIABLE_EDITOR varfrem 2 true false VARIABLE_EDITOR gamemode true false CODE_EDITOR Init Page true false CODE_EDITOR Modeset true false CODE_EDITOR objective true false CODE_EDITOR svg true false '+ ' '+ ' '+ ' '+ ' '+ ''; container.innerHTML = svggradient; document.body.appendChild(container); //"url(#mygrandient1)" ]]> CODE_EDITOR FixRel Page true false player2score?"Beta is Winning":"Alpha is Winning");} else if (mode==2){_view.Status.setProperty("Text",countscore==count2score?"Draw":countscore>count2score?"Beta is Winning":"Alpha is Winning");} else if (mode==8){_view.Status.setProperty("Text",digitalscore==digital2score?"Draw":digitalscore>digital2score?"Beta is Winning":"Alpha is Winning");} ]]> LIBRARY_EDITOR add true false LIBRARY_EDITOR MissionaryCheck true false LIBRARY_EDITOR fullscreen true false LIBRARY_EDITOR popzero true false HTML_VIEW_EDITOR HtmlView Page true false 0 0 0 800 600 true true Elements.Panel true Elements.PlottingPanel 12&&dicenumber[1]>12){ stop=true; totalscore= cardscore.reduce(add,0); player1score=player1score+totalscore; missionaryCheck(); player1end=true; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); // text="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); text="No New Numbers to Flip. Game End! Score = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); } else if(cardscore[dicenumber[1]-1]==0&&cardscore[dicenumber[0]-1]==0&&cardscore[a-1]==0) {stop=true; totalscore= cardscore.reduce(add,0); player1score=player1score+totalscore; missionaryCheck(); player1end=true; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); // text="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); text="No New Numbers to Flip. Game End! Score = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); } else { //Thai Style Check if (mode==7){text="Select either "+dicenumber[0]+", "+dicenumber[1]+" or "+a+"."; stop=true;} //Not thai style else { cardscore[dicenumber[1]-1]=0; cardscore[dicenumber[0]-1]=0; cardscore[a-1]=0; numbercolor[dicenumber[1]-1]="yellow"; cardcolor[dicenumber[1]-1]="green"; numbercolor[dicenumber[0]-1]="yellow"; cardcolor[dicenumber[0]-1]="green"; numbercolor[a-1]="yellow"; cardcolor[a-1]="green"; text="You rolled "+dicenumber[0]+" and "+dicenumber[1]+"!";} } if (a==7&&mode==3){ totalscore= cardscore.reduce(add,0); missionaryCheck(); player1score=player1score+totalscore; // text="Seven!\nGame End!\nScore = "+totalscore; text="Seven! Game End! Score = "+totalscore; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); player1end=true; stop=true;} } }]]> Elements.Shape2D 12&&dicenumber[1]>12){ stop=true; totalscore= cardscore.reduce(add,0); player1score=player1score+totalscore; missionaryCheck(); player1end=true; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); // text="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); text="No New Numbers to Flip. Game End for you! Score = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); } else if(cardscore[dicenumber[1]-1]==0&&cardscore[dicenumber[0]-1]==0&&cardscore[a-1]==0) {stop=true; totalscore= cardscore.reduce(add,0); player1score=player1score+totalscore; missionaryCheck(); player1end=true; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); // text="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); text="No New Numbers to Flip. Game End! Score = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); } else { //Thai Style Check if (mode==7){text="Select either "+dicenumber[0]+", "+dicenumber[1]+" or "+a+"."; stop=true;} //Not thai style else { cardscore[dicenumber[1]-1]=0; cardscore[dicenumber[0]-1]=0; cardscore[a-1]=0; numbercolor[dicenumber[1]-1]="yellow"; cardcolor[dicenumber[1]-1]="green"; numbercolor[dicenumber[0]-1]="yellow"; cardcolor[dicenumber[0]-1]="green"; numbercolor[a-1]="yellow"; cardcolor[a-1]="green"; text="You rolled "+dicenumber[0]+" and "+dicenumber[1]+"!";} } if (a==7&&mode==3){ totalscore= cardscore.reduce(add,0); missionaryCheck(); player1score=player1score+totalscore; // text="Seven!\nGame End!\nScore = "+totalscore; text="Seven! Game End! Score = "+totalscore; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); player1end=true; stop=true;} } ]]> Elements.ShapeSet2D 0) { cardscore[dicenumber[0]-1]=0; numbercolor[dicenumber[0]-1]="yellow"; cardcolor[dicenumber[0]-1]="green"; text="You selected "+dicenumber[0]+"!"; stop=false; } else if (objectinteracted+1==dicenumber[1]&&cardscore[dicenumber[1]-1]>0) { cardscore[dicenumber[1]-1]=0; numbercolor[dicenumber[1]-1]="yellow"; cardcolor[dicenumber[1]-1]="green"; text="You selected "+dicenumber[1]+"!"; stop=false; } else if (objectinteracted+1==a&&cardscore[a-1]>0) { cardscore[a-1]=0; numbercolor[a-1]="yellow"; cardcolor[a-1]="green"; text="You selected "+a+"!"; stop=false; } } ]]> Elements.ShapeSet2D 0) { cardscore[dicenumber[0]-1]=0; numbercolor[dicenumber[0]-1]="yellow"; cardcolor[dicenumber[0]-1]="green"; text="You selected "+dicenumber[0]+"!"; stop=false; } else if (objectinteracted+1==dicenumber[1]&&cardscore[dicenumber[1]-1]>0) { cardscore[dicenumber[1]-1]=0; numbercolor[dicenumber[1]-1]="yellow"; cardcolor[dicenumber[1]-1]="green"; text="You selected "+dicenumber[1]+"!"; stop=false; } else if (objectinteracted+1==a&&cardscore[a-1]>0) { cardscore[a-1]=0; numbercolor[a-1]="yellow"; cardcolor[a-1]="green"; text="You selected "+a+"!"; stop=false; } } ]]> Elements.TextSet2D Elements.ShapeSet2D Elements.TextSet2D Elements.TextSet2D Elements.Text2D false Elements.Panel Elements.ComboBox 0)? opts[0]:""; // selected option /*["Golf","Missionary","Unlucky 7", "3 Down Extreme","Against all Odds", "Even Stevens","Digital"] */ _initialize(); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); _view.numbershape2.setProperty("EnabledPosition","ENABLED_NONE"); dicedisplay=["⚅","⚅"]; dice2display=["⚅","⚅"]; if (option=="Golf"){mode=1;} else if (option=="Missionary"){mode=2;} else if (option=="Unlucky 7"){ mode=3; numbercolor[6]="yellow"; cardcolor[6]="green"; number2color[6]="yellow"; card2color[6]="green"; cardscore[6]=0; card2score[6]=0; } else if (option=="3 Down Extreme"){ mode=4; for (var i=0;i<3;i++){ numbercolor[i]="yellow"; cardcolor[i]="green"; number2color[i]="yellow"; card2color[i]="green"; cardscore[i]=0; card2score[i]=0; } } else if (option=="Against all Odds"){ mode=5; for (var i=1;i<12;i+=2){ numbercolor[i]="yellow"; cardcolor[i]="green"; number2color[i]="yellow"; card2color[i]="green"; cardscore[i]=0; card2score[i]=0; } } else if (option=="Even Stevens"){ mode=6; for (var i=0;i<12;i+=2){ numbercolor[i]="yellow"; cardcolor[i]="green"; number2color[i]="yellow"; card2color[i]="green"; cardscore[i]=0; card2score[i]=0; } } else if (option=="Thai style") {mode=7; thaicheck=true; _view.numbershape.setProperty("EnabledPosition","ENABLED_NO_MOVE"); _view.numbershape2.setProperty("EnabledPosition","ENABLED_NO_MOVE");} else if (option=="Digital") {mode=8; for (var i=9;i<12;i++){ numbercolor[i]="yellow"; cardcolor[i]="green"; number2color[i]="yellow"; card2color[i]="green"; cardscore[i]=0; card2score[i]=0; } } else if (option=="2012") {mode=9; dicedisplay=[20,20]; dice2display=[20,20];} ]]> Elements.Label Elements.Label Elements.Label Elements.Button true Elements.PlottingPanel 12&&dice2number[1]>12&&mode==9) {stop2=true; total2score= card2score.reduce(add,0); player2score=player2score+total2score; missionary2Check(); player2end=true; pop2zero(); digital2score=parseInt(digital2score,10)+parseInt(card2score.join(''),10); _view.numbershape2.setProperty("EnabledPosition","ENABLED_NONE"); //text2="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(card2score.join(''),10):mode==2?count:total2score); text2="No New Numbers to Flip. Game End for you! Score = "+(mode==8?parseInt(card2score.join(''),10):mode==2?count:total2score); } else if(card2score[dice2number[1]-1]==0&&card2score[dice2number[0]-1]==0&&card2score[a-1]==0) {stop2=true; total2score= card2score.reduce(add,0); player2score=player2score+total2score; missionary2Check(); player2end=true; pop2zero(); digital2score=parseInt(digital2score,10)+parseInt(card2score.join(''),10); _view.numbershape2.setProperty("EnabledPosition","ENABLED_NONE"); // text2="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(card2score.join(''),10):mode==2?count:total2score); text2="No New Numbers to Flip. Game End for you! Score = "+(mode==8?parseInt(card2score.join(''),10):mode==2?count:total2score); } else { //Thai Style Check if (mode==7){text2="Select either "+dice2number[0]+", "+dice2number[1]+" or "+a+"."; stop2=true;} //Not thai else {card2score[dice2number[1]-1]=0; card2score[dice2number[0]-1]=0; card2score[a-1]=0; number2color[dice2number[1]-1]="yellow"; card2color[dice2number[1]-1]="green"; number2color[dice2number[0]-1]="yellow"; card2color[dice2number[0]-1]="green"; number2color[a-1]="yellow"; card2color[a-1]="green"; text2="You rolled "+dice2number[0]+" and "+dice2number[1]+"!";} } if (a==7&&mode==3){ total2score= card2score.reduce(add,0); missionary2Check(); player2score=player2score+total2score; pop2zero(); digital2score=parseInt(digital2score,10)+parseInt(card2score.join(''),10); text2="Seven! Game End! Score = "+total2score; // text2="Seven!\nGame End!\nScore = "+total2score; player2end=true; stop2=true;}} }]]> Elements.Shape2D Elements.ShapeSet2D 0) { card2score[dice2number[0]-1]=0; number2color[dice2number[0]-1]="yellow"; card2color[dice2number[0]-1]="green"; text2="You selected "+dice2number[0]+"!"; stop2=false; } else if (objectinteracted2+1==dice2number[1]&&card2score[dice2number[1]-1]>0) { card2score[dice2number[1]-1]=0; number2color[dice2number[1]-1]="yellow"; card2color[dice2number[1]-1]="green"; text2="You selected "+dice2number[1]+"!"; stop2=false; } else if (objectinteracted2+1==a&&card2score[a-1]>0) { card2score[a-1]=0; number2color[a-1]="yellow"; card2color[a-1]="green"; text2="You selected "+a+"!"; stop2=false; } } ]]> Elements.ShapeSet2D 0) { card2score[dice2number[0]-1]=0; number2color[dice2number[0]-1]="yellow"; card2color[dice2number[0]-1]="green"; text2="You selected "+dice2number[0]+"!"; stop2=false; } else if (objectinteracted2+1==dice2number[1]&&card2score[dice2number[1]-1]>0) { card2score[dice2number[1]-1]=0; number2color[dice2number[1]-1]="yellow"; card2color[dice2number[1]-1]="green"; text2="You selected "+dice2number[1]+"!"; stop2=false; } else if (objectinteracted2+1==a&&card2score[a-1]>0) { card2score[a-1]=0; number2color[a-1]="yellow"; card2color[a-1]="green"; text2="You selected "+a+"!"; stop2=false; } } ]]> Elements.TextSet2D Elements.ShapeSet2D Elements.TextSet2D Elements.TextSet2D Elements.Text2D false Elements.Panel Elements.Button 12&&dicenumber[1]>12){ stop=true; totalscore= cardscore.reduce(add,0); player1score=player1score+totalscore; missionaryCheck(); player1end=true; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); text="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); } else if(cardscore[dicenumber[1]-1]==0&&cardscore[dicenumber[0]-1]==0&&cardscore[a-1]==0) {stop=true; totalscore= cardscore.reduce(add,0); player1score=player1score+totalscore; missionaryCheck(); player1end=true; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); _view.numbershape.setProperty("EnabledPosition","ENABLED_NONE"); text="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(cardscore.join(''),10):mode==2?count:totalscore); } else { //Thai Style Check if (mode==7){text="Select either "+dicenumber[0]+", "+dicenumber[1]+" or "+a+"."; stop=true;} //Not thai style else { cardscore[dicenumber[1]-1]=0; cardscore[dicenumber[0]-1]=0; cardscore[a-1]=0; numbercolor[dicenumber[1]-1]="yellow"; cardcolor[dicenumber[1]-1]="green"; numbercolor[dicenumber[0]-1]="yellow"; cardcolor[dicenumber[0]-1]="green"; numbercolor[a-1]="yellow"; cardcolor[a-1]="green"; text="You rolled "+dicenumber[0]+" and "+dicenumber[1]+"!";} } if (a==7&&mode==3){ totalscore= cardscore.reduce(add,0); missionaryCheck(); player1score=player1score+totalscore; text="Seven!\nGame End!\nScore = "+totalscore; popzero(); digitalscore=parseInt(digitalscore,10)+parseInt(cardscore.join(''),10); player1end=true; stop=true;} } ]]> Elements.Button 12&&dice2number[1]>12&&mode==9) {stop2=true; total2score= card2score.reduce(add,0); player2score=player2score+total2score; missionary2Check(); player2end=true; pop2zero(); digital2score=parseInt(digital2score,10)+parseInt(card2score.join(''),10); _view.numbershape2.setProperty("EnabledPosition","ENABLED_NONE"); text2="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(card2score.join(''),10):mode==2?count:total2score); } else if(card2score[dice2number[1]-1]==0&&card2score[dice2number[0]-1]==0&&card2score[a-1]==0) {stop2=true; total2score= card2score.reduce(add,0); player2score=player2score+total2score; missionary2Check(); player2end=true; pop2zero(); digital2score=parseInt(digital2score,10)+parseInt(card2score.join(''),10); _view.numbershape2.setProperty("EnabledPosition","ENABLED_NONE"); text2="No New Numbers\nto Flip. Game End!\nScore = "+(mode==8?parseInt(card2score.join(''),10):mode==2?count:total2score); } else { //Thai Style Check if (mode==7){text2="Select either "+dice2number[0]+", "+dice2number[1]+" or "+a+"."; stop2=true;} //Not thai else {card2score[dice2number[1]-1]=0; card2score[dice2number[0]-1]=0; card2score[a-1]=0; number2color[dice2number[1]-1]="yellow"; card2color[dice2number[1]-1]="green"; number2color[dice2number[0]-1]="yellow"; card2color[dice2number[0]-1]="green"; number2color[a-1]="yellow"; card2color[a-1]="green"; text2="You rolled "+dice2number[0]+" and "+dice2number[1]+"!";} } if (a==7&&mode==3){ total2score= card2score.reduce(add,0); missionary2Check(); player2score=player2score+total2score; pop2zero(); digital2score=parseInt(digital2score,10)+parseInt(card2score.join(''),10); text2="Seven!\nGame End!\nScore = "+total2score; player2end=true; stop2=true;}}]]> Elements.Panel Modes from  Wikipedia https://en.wikipedia.org/wiki/Shut_the_Box
Golf – A player's score is the sum of the numbers remaining uncovered at the end of his turn. The player with the lowest score wins.
Missionary – A player's score is the total number (count) of the tiles remaining uncovered at the end of his turn. For example, a player scores 3 if at the end of his turn 3 tiles remain open. The player with the lowest score wins.
Unlucky number 7 – A standard game, when a 7 is rolled, the game stops.
3 down extreme – numbers 1, 2 and 3 are pre dropped, leaving numbers 4 to 9 up.
Lucky number 7 – The only number up is 7, and the first person to roll a 7 wins.
Unlucky number 7 – A standard game, when a 7 is rolled, the game stops.
Against all odds – All odd numbers are up and evens down.
Even Stevens – All even numbers are up and odds down.
Thai style (Jackpot) – Always roll two dice, but only cover one tile matching one of the dice or their sum. For example, if the dice show a 2 and a 3 you may cover one of 2, 3, or 5.
Digital – A player's score at the end of the turn is the number obtained by reading the up digits as a decimal number from left to right. For example, if 1, 2, and 5 are left up the score is 125.
2012 – All 12 are up, but use a 20-sided Dungeons and Dragons die rather than the pair of 6 dice: 20-sided die playing 12 numbers – 2012. This may seem a little geeky, but it adds a new level of excitement to a tired game.
]]>