Review Algorithmic Thinking by Building a Dice Game - Step 7

Tell us what’s happening:

i am getting stuck here on this step . i am sure i did the right steps and my code is correct too but it still says that my code is wrong plus i am confused by the ", score = 0 " how is this possible it throws an error if i use

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region



rollDiceBtn.addEventListener("click", () => {
  if (rolls === 3) {
    alert("You have made three rolls this round. Please select a score.");
  } else {
    rolls++;
    rollDice();
    updateStats();
    getHighestDuplicates(diceValues);
  }
});

function getHighestDuplicates(diceValuesArr) {
  let counts = {};
  let highestCount = 0;

  const totalScore = diceValuesArr.reduce((sum, value) => sum + value, 0);

  diceValuesArr.forEach((value) => {
    counts[value] = (counts[value] || 0) + 1;
    highestCount = Math.max(highestCount, counts[value]);
  });

  // Less than three of a kind
  if (highestCount < 3) {
    updateRadioOption( , score=0); // final radio option 
 // i am stuck here 
  }

  // Three of a kind (only)
  if (highestCount === 3) {
    updateRadioOption(0, totalScore); // Three of a Kind
  }

  // Four of a kind
  if (highestCount >= 4) {
    updateRadioOption(1, totalScore); // Four of a Kind
    updateRadioOption(0, totalScore); // Three of a Kind
  }
}

  

// 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/143.0.0.0 Safari/537.36

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 7

May can you share only the user editable code?
You know, just from the darker area.

Aren’t you seeing a syntax error in the console?

How many arguments does updateRadioOption() take? Which option gives a score of 0 when selected?

Regardless of the outcome, the final option should be updated with a score of 0 .

Is the final option always updated in your code?

Does your code work if the dice array is [2, 3, 3, 4, 1] ?

the first one is that i think

that is what is confusing because first i had 2 , 0 becuase its less than 3, but the promt says i need to have ( , score = 0) for the code if its less than 3

my own reply below is just in case anyone wants to see the full code, the part in question is the first post above to which we are all commenting

Would you show where you are seeing this prompt?

this is what i keep getting , im confused

I can see why you might be confused by that. But this instruction:

Regardless of the outcome, the final option should be updated with a score of 0 .

is really saying the same thing as the test feedback, just in a different way.

Even if the dice roll is not a small straight or large straight (less than three of the same number), you should always enable the last radio option.

You can create an issue to make the test feedback clearer at: