Tell us what’s happening:
Can you guys help to find the problem?
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
const checkForStraights = (arr) => {
const sorted = arr.sort((a,b) => a - b);
const diceNum = Number(sorted.join(""));
if(diceNum === 12345 || diceNum === 23456) {
updateRadioOption(4, 40);
updateRadioOption(3, 30);
}
if (diceNum === 1234 || diceNum === 2345 || diceNum === 3456) {
updateRadioOption(3, 30);
}
updateRadioOption(5, 0)
console.log(diceNum)
}
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
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 14