Arcdeamonofire / project-1

Project 1 of WDI-Remote: Backgammon in Browser Game
0 stars 0 forks source link

Create a roll the dice function #28

Closed Arcdeamonofire closed 8 years ago

Arcdeamonofire commented 8 years ago

Have a function that gets gets random numbers between 1-6 for the dice values. Will need two for each.

Arcdeamonofire commented 8 years ago

finds a random number between 1 - 6 and then sets it to the array. It will be called each time the roll the dice button is pressed.

var random = function(){
    return 1 + Math.floor(Math.random() * 6);
}
var $die1 = random();
var $die2 = random();
$dice = [$die1, $die2];