diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/review-algorithmic-thinking-by-building-a-dice-game/657e230500602983e01fff6e.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/review-algorithmic-thinking-by-building-a-dice-game/657e230500602983e01fff6e.md index 3f3760e5810..fe6634e6d5b 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/review-algorithmic-thinking-by-building-a-dice-game/657e230500602983e01fff6e.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/review-algorithmic-thinking-by-building-a-dice-game/657e230500602983e01fff6e.md @@ -56,13 +56,18 @@ assert.strictEqual(scoreSpans[3].innerText, ", score = 30"); If no straight is rolled, your `checkForStraights` function should enable the final radio button, set the value to `0`, and update the displayed text to `, score = 0`. ```js -resetRadioOptions(); -checkForStraights([1,1,1,1,1]); -assert.isTrue(scoreInputs[3].disabled); -assert.isTrue(scoreInputs[4].disabled); -assert.isFalse(scoreInputs[5].disabled); -assert.strictEqual(scoreInputs[5].value, "0"); -assert.strictEqual(scoreSpans[5].innerText, ", score = 0"); +const assertNoStraight = (_diceValuesArr) => { + resetRadioOptions(); + checkForStraights(_diceValuesArr); + assert.isTrue(scoreInputs[3].disabled); + assert.isTrue(scoreInputs[4].disabled); + assert.isFalse(scoreInputs[5].disabled); + assert.strictEqual(scoreInputs[5].value, "0"); + assert.strictEqual(scoreSpans[5].innerText, ", score = 0"); +} + +assertNoStraight([1,1,1,1,1]); +assertNoStraight([1,1,4,4,4]); ``` You should call the `checkForStraights` function when the `rollDiceBtn` is clicked.