From 1a2babadb6565011ccc96228191f81ce25a21e57 Mon Sep 17 00:00:00 2001 From: IgrisBRC Date: Sat, 13 Jul 2024 16:15:41 +0530 Subject: did some renaming --- public/game.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/game.js b/public/game.js index d72530d..05ddc66 100644 --- a/public/game.js +++ b/public/game.js @@ -75,7 +75,7 @@ for (let i = 0; i < 8; i++) { let squares = document.getElementsByClassName('box') -let prev = ["dummy"] +let previously_highlighted_squares = ["dummy"] for (let i = 0; i < squares.length; i++) { @@ -89,15 +89,15 @@ for (let i = 0; i < squares.length; i++) { let moves = move(board, square[0], square[1]) - for (let i = 0; i < prev.length; i++) { - document.getElementById(prev[i]).classList.remove('highlight') + for (let i = 0; i < previously_highlighted_squares.length; i++) { + document.getElementById(previously_highlighted_squares[i]).classList.remove('highlight') } for (let i = 0; i < moves.length; i++) { document.getElementById(`${alphabet[moves[i][1]]}${8 - moves[i][0]}`).classList.add('highlight') - prev.push(`${alphabet[moves[i][1]]}${8 - moves[i][0]}`) + previously_highlighted_squares.push(`${alphabet[moves[i][1]]}${8 - moves[i][0]}`) } }) -- cgit v1.2.3