Pig Dice

By {Rob, Hans, Cameron, and Amiya}

Description: This website contains a game that allows 2 players 'roll dice' and see who can make it to 100 first. Don't be fooled, it's not as easy as it sounds! If the player rolls a 1, that player's current score reverts to 0.

TESTS: Pig Dice

Describe: diceRoll Test: This will allow player to roll the dice Code: let roll = Math.floor(Math.random()*6)+1; Expectation: return random number 1-6 each 'roll'

Test: This will declare a player Code: function Player(name, score) Expectation: this.name=name this.score=score

Test: This will chronologically list out the function's operations. Code: this.activePlayer; this.endScore; this.sumRolled Expectation: function wil process through each listed command in order.

Test: This will add the players rolled number to their score _Code: Turn.prototype.addScore=function(roll){ this.sumRolled = this.sumRolled + roll; return this.sumRolled; } Expectation: return sum of total score and current roll

_Test: currentScore _Code:let currentScore = sumRolled + rolled _Expectation: