Learn Intermediate Algorithmic Thinking by Building a Dice Game - Step 85

Tell us what’s happening:

I am getting this error:
You should call your updateRadioOption with 3 and 30 for the arguments.

for (smallStraightsArr of uniqueNumbersStr.includes(straight)){
updateRadioOption(3,30);
};


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Intermediate Algorithmic Thinking by Building a Dice Game - Step 85

It looks like you have most of the information but have some errors with the for of loop and are missing the if statement inside the loop.

If you are going to use a for...of loop, it needs to contain a variable and iterable.

Here is the example from MDN docs

for (variable of iterable){
// some code here
}

The directions say, if using for...of , the loop variable should also be straight .

the directions also say to iterate through smallStraightsArr

once you fix the for...of loop, you need an if statement

The directions say

if uniqueNumbersStr has a combination that matches a small straight,

It looks like that was what you were trying to do here but just placed it in the wrong place.

once you fix those things, then the tests should pass

1 Like

Thank you. Very helpful. I got it!

1 Like

just a question, why we use a loop here, why we don’t use condition statement directly like large straight

The original version used if (smallStraightsArr.includes(uniqueNumbersStr))
But this step was updated to fix some game logic.
You can view the whole discussion here

and the PR fix here

2 Likes