Review Algorithmic Thinking by Building a Dice Game - Step 11

Tell us what’s happening:

Despite my best efforts, I can’t seem to figure out whats wrong! It checks if the player played 6 rounds, and shows a message after 500ms!

Your code so far

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

/* file: styles.css */

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

        if (round > 6) {
      setTimeout(() => {
        alert(`Game Over! Your total score is ${score}`);
        
      }, 500);
    }

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 11

What’s the maximum number of rounds you can play?

6, and the counter starts at 1, so after the player plays rounds number 6, when he clicks on the button, it shows the alert with a delay, it actually works ok on the preview!

And what round number is showing in the preview when the alert displays?

The number 7, because it is the start of the next round. right? And it should reset this number on the next lessons I presume.

And how can you change your code to recognize the end of the 6th round rather than starting a new round?

I tried this:

   if (round === 6) {
      setTimeout(() => {
        alert(`Game Over! Final score: ${score}`)
      }, 500);
}

But no luck…

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

DUUUUUDE, thanks! I had to change my browser, it worked on Edge, can you believe it!

Thanks a lot!