Tell us what’s happening:
The game is behaving as expected, I am not sure why the challenge won’t pass
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const getHighestDuplicates = (numArr) => {
let count = [0,0,0,0,0,0];
numArr.forEach((e) => {
count[e-1]++;
});
if (Math.max(...count) >= 3) {
updateRadioOption(0,diceValuesArr.reduce((acc,cur) => acc+cur,0));
}
if (Math.max(...count) >= 4) {
updateRadioOption(1,diceValuesArr.reduce((acc,cur) => acc+cur,0));
}
updateRadioOption(5,0);
}
rollDiceBtn.addEventListener("click", () => {
if (rolls === 3) {
alert("You have made three rolls this round. Please select a score.");
} else {
rolls++;
rollDice();
updateStats();
getHighestDuplicates(diceValuesArr);
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7