Adjust variable names for better understanding

This commit is contained in:
Manuel Thalmann 2022-12-13 11:28:48 +01:00
parent be4956f360
commit 391edbed72
No known key found for this signature in database
GPG key ID: 5FD9AD3CCDDBD27B

View file

@ -84,13 +84,13 @@ export class Game
let board = document.getElementById(this.id); let board = document.getElementById(this.id);
board.innerHTML = ""; 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[]} */ /** @type {Node[]} */
let children = []; let children = [];
let playerId = this.board[i][j]; let playerId = this.board[y][x];
if (playerId !== "") if (playerId !== "")
{ {
@ -111,7 +111,7 @@ export class Game
field.onclick = () => field.onclick = () =>
{ {
this.board[i][j] = this.state.currentPlayer; this.board[y][x] = this.state.currentPlayer;
this.state.turnCount++; this.state.turnCount++;
this.draw(); this.draw();
}; };