Review Algorithmic Thinking by Building a Dice Game - Step 14

Tell us what’s happening:

I am having this message, “If a small straight is rolled, your checkForStraights function should enable the fourth radio button, set the value to 30, and update the displayed text to , score = 30” what is it exactly meaning by saying “, score = 30” I have no clue. Been stuck on this one for a while now.

const checkForStraights = (arr) => {
  const counts = {};
  const sorted = arr.sort((a, b) => a-b);
  const diceNum = Number(sorted.join());
  if (diceNum.includes(1234 || 2345 || 3456)) {
    updateRadioOption(3, score = 30);
  }
  if (diceNum.includes(12345 || 23456)) {
    updateRadioOption(4, score = 40);    
  } 
  updateRadioOption(5, score = 0);
  return counts;
}

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 14

  • does reading through example given in exercise help?

For the last portion of the game, you will need to create an algorithm that checks for the presence of a straight. A small straight is when four of the dice have consecutive values in any order (Ex. in a roll of 41423, we have 1234) resulting in a score of 30 points. A large straight is when all five dice have consecutive values in any order (Ex. in a roll of 35124, we have 12345) resulting in a score of 40 points.

happy coding :slight_smile: