Review Algorithmic Thinking by Building a Dice Game - Step 9

Tell us what’s happening:

I do not understand what I am doing wrong
It keeps saying that “Your updateScore function should add the value of the first parameter to the total score.” , I do not know what I need to do. Please let me know if there is anything else wrong in my code, that might potentially stop me from passing this step.

Your code so far

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

/* file: styles.css */

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

function updateScore(selectedValue, achieved) {
    totalScore += selectedValue;
    totalScore.textContent = `Total Score: ${total}`;
    const listItem = document.createElement('li');
    listItem.textContent = `${achieved} : ${selectedValue}`;
    scoreHistory.appendChild(listItem);
}

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

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 9

  • it needs to be done with “score” not “totalScore”
  • only update with “score” value no other text is required

happy coding :slight_smile:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.