freeCodeCamp: Dice Game - Missing some small straights

Describe the Issue

You can get a small straight with "12346" but that’s excluded.

Affected Page

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-intermediate-algorithmic-thinking-by-building-a-dice-game/step-84

Your code

  if (smallStraightsArr.some(straight => uniqueNumbersStr.includes(straight))) {
    updateRadioOption(3, 30);
  }

Expected behavior

All valid small straights captured.

We should put Step 85 before the current Step 84, then update Step 84 to use something like the logic given above.

Forum Post

https://forum.freecodecamp.org/t/learn-intermediate-algorithmic-thinking-by-building-a-dice-game-step-87/679303

System

All

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

Step 85’s current code is simpler than Step 84 needs to be. I think its better to introduce a simpler case of an idea first.

Though if we change the smallStraightsArr array to smallStraightsArrWithAllPossibleExtraDieValues, then the logic would be the same… but I still don’t love that approach.