Tell us what’s happening:
I got stuck on this , It didn’t pass . I have tried to manually disable the radio input but still didn’t worked. The fourth radio option means the index =3 , I have done so in the function call "updateRadioOption(3,30) "but still it ask to update the score, i did that manually selecting and using textContent property but still didn’t get it. Also it tells me to leave the fifth radio option disabled , do i need to select it manually and use .disabled = true ? to do so?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const checkForStraights = arr=>{
const sortedArr = arr.sort((a,b)=>a-b);
const uniqueNumbers =[...new Set(sortedArr)];
const largeStraight = [[1,2,3,4,5],[2,3,4,5,6]];
const smallStraight = [[1,2,3,4],[2,3,4,5],[3,4,5,6]];
for(let arr of largeStraight){
if(JSON.stringify(arr)===JSON.stringify(uniqueNumbers)){
updateRadioOption(4,40);
updateRadioOption(3,30);
break;
}else{
updateRadioOption(5,0);
}
};
for(let arr of smallStraight){
if(JSON.stringify(arr)===JSON.stringify(uniqueNumbers)){
updateRadioOption(3,30);
scoreInputs[4].disabled = true;
break;
}
};
}
rollDiceBtn.addEventListener("click", () => {
if (rolls === 3) {
alert("You have made three rolls this round. Please select a score.");
} else {
rolls++;
resetRadioOptions();
rollDice();
updateStats();
getHighestDuplicates(diceValuesArr);
detectFullHouse(diceValuesArr);
checkForStraights(diceValuesArr);
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 14