diff --git a/frontend/public/games/Tower of Hanoi/script.js b/frontend/public/games/Tower of Hanoi/script.js index 418cd71c..6df50157 100644 --- a/frontend/public/games/Tower of Hanoi/script.js +++ b/frontend/public/games/Tower of Hanoi/script.js @@ -61,7 +61,7 @@ pegs.forEach((peg, index) => { let disk = towers[from].pop(); towers[to].push(disk); moves++; - movesText.innerText = "Moves: " + moves; + movesText.textContent = "Moves: " + moves; message.innerText = ""; render(); checkWin(); diff --git a/frontend/public/scripts/memory.js b/frontend/public/scripts/memory.js index bb4a7e10..9dc728e8 100644 --- a/frontend/public/scripts/memory.js +++ b/frontend/public/scripts/memory.js @@ -120,7 +120,7 @@ function gameWon() { gameActive = false; // Check for best score - if (!bestScore || moves < parseInt(bestScore)) { + if (!bestScore || moves < parseInt(bestScore, 10)) { bestScore = moves; localStorage.setItem('memoryBestScore', bestScore); document.getElementById('bestScore').textContent = bestScore;