From 391edbed7290f8421f14a85d5078f1ba31b8f4de Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 13 Dec 2022 11:28:48 +0100 Subject: [PATCH] Adjust variable names for better understanding --- src/js/Game.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/Game.js b/src/js/Game.js index a2b0d8c..56df0c9 100644 --- a/src/js/Game.js +++ b/src/js/Game.js @@ -84,13 +84,13 @@ export class Game let board = document.getElementById(this.id); board.innerHTML = ""; - for (let i = 0; i < Game.#height; i++) + for (let y = 0; y < Game.#height; y++) { - for (let j = 0; j < Game.#width; j++) + for (let x = 0; x < Game.#width; x++) { /** @type {Node[]} */ let children = []; - let playerId = this.board[i][j]; + let playerId = this.board[y][x]; if (playerId !== "") { @@ -111,7 +111,7 @@ export class Game field.onclick = () => { - this.board[i][j] = this.state.currentPlayer; + this.board[y][x] = this.state.currentPlayer; this.state.turnCount++; this.draw(); };