Tell us what’s happening:
Hello guys.
Technically it works. But the test won’t let it pass. Spent so much time trying to understand what could be wrong. I don’t know what to do anymore. Do you have any clue?
Thanks a lot!
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const getHighestDuplicates = (diceList) => {
let arr = [0,0,0,0,0];
let sum = 0;
for(let i=0 ; i < 5 ; i++) {
arr[diceList[i].textContent]++;
sum+=Number(diceList[i].textContent);
}
arr.sort((a,b)=>b-a)
if(arr[0]>=4) {updateRadioOption(1, sum);}
if(arr[0]>=3) {updateRadioOption(0, sum);}
else {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(listOfAllDice);
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7