Review Algorithmic Thinking by Building a Dice Game - Step 1

Tell us what’s happening:

what’s wrong?
All of your new variables should be declared with let

Your code so far

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

/* file: styles.css */

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

const listOfAllDice = document.querySelectorAll(".die");
const scoreInputs = document.querySelectorAll("#score-options input");
const scoreSpans = document.querySelectorAll("#score-options span");
const roundElement = document.getElementById("current-round");
const rollsElement = document.getElementById("current-round-rolls");
const totalScoreElement = document.getElementById("total-score");
const scoreHistory = document.getElementById("score-history");
const rollDiceBtn = document.getElementById("roll-dice-btn");
const keepScoreBtn = document.getElementById("keep-score-btn");

const rulesBtn = document.getElementById("rules-btn");
const rulesContainer = document.querySelector(".rules-container");


rulesBtn.addEventListener("toggle", ()=>{
  rulesContainer.style.display = "block";
})

const isModalShowing = false;
const diceValuesArr = [];

let rolls = 0;
let score = 0;
let total = 0;
let round = 1;

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

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 1

Hi,
All of your variables should be declared with let. You still have some variables with const, so change those.
Good luck!

1 Like

thanks, The problem was in front of my eyes but I could not see.

1 Like