Pig Boss, Big Boss

Saturday, May 6, 2017

Actually, this is a medium Boss (i.e. a midterm).

Pig Dice Game Boss (Midterm)

Game Rules, Two Dice variant:

  • Two dice rolled
  • Total of both dice added to turn score
  • If a single 1 is rolled, points lost for turn–no turn score–and turn is over
  • If two 1s (double 1s) are rolled, no points for turn and player loses all points–score reset to 0 and turn is over
  • If doubles are rolled (not 1s), sum of points added to turn score and player must roll again
  • Player may choose to end turn or roll again
  • First player to 100 points wins

see: https://en.wikipedia.org/wiki/Pig_(dice_game) for details

also: https://en.wikipedia.org/wiki/Pass_the_Pigs for version with pigs


  • Some code already in place, but is not be completely functional or error-free
  • There are some clues in the code, if you are paying attention
  • You will need to write code to make the game playable
  • Some errors may exist in the HTML but not in the CSS
  • To beat this Boss you must get this code to work as a playable game
  • Spend quality time thinking through the problem and identifying the inputs, processing, and outputs.
  • Output die roll results, turn score results, and total score as appropriate
  • Indicate winner and game over
  • Submit your HTML and JS files to the eCompanion dropbox basket by Midnight, Saturday May 6th. Files not submitted will receive a 0 for midterm.


  • This is a basic game in terms of game play, but still challenging enough to program using what’s been covered to date.
  • There are definitely ways to ‘do it better’. Most of those involve stuff we haven’t covered yet.
  • You may refer to the textbook, to the MDN JavaScript reference, and each other. But the solution you program must be your own work.

This text is included as a block comment on the JS file.

Download the zip file: pig-boss

Due Date

This assignment is due: Saturday, May 6, 2017.

Leave a Reply