Adjust variable names for better understanding
This commit is contained in:
parent
be4956f360
commit
391edbed72
|
@ -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();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue