diff options
author | IgrisBRC <[email protected]> | 2024-07-13 16:15:41 +0530 |
---|---|---|
committer | IgrisBRC <[email protected]> | 2024-07-13 16:15:41 +0530 |
commit | 1a2babadb6565011ccc96228191f81ce25a21e57 (patch) | |
tree | a2a15a1d889190b59cc079b9f8c0abc4c0c8e917 /public | |
parent | 243429d24db08b01ec2d1d00d7e17962b0b2bcac (diff) |
did some renaming
Diffstat (limited to 'public')
-rw-r--r-- | public/game.js | 8 |
1 files 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]}`) } }) |