I've been working on a dice game where if either of the dice rolls a 1, the score is set to 1. However, I'm having trouble getting that part of my code to work properly. I'm confident that everything else is functioning correctly.
var die1 = Math.floor(Math.random()*6 + 1);
var die2 = Math.floor(Math.random()*6 + 1);
var score;
if (die1 === 1 || die2 === 1) {
score = 1;
}
if (die1 !== 1 && die2 !== 1) {
score = die1 + die2;
}
console.log("You rolled a " + die1 + " and a " + die2 + " for a score of " + score);