reset()
    {
        this.#totalMoves = 0;
        this.#whiteMoves = true;
        this.#turnsRemaining = this.#cols * this.#rows;
        this.outcome = ONGOING;
        this.gameLog = new Array();
        
        this.board = new Array(this.#rows);
        
        for (let r = 0; r < this.#rows; r++) {
            this.board[r] = new Array(this.#cols);
            for (let c = 0; c < this.#cols; c++)
                this.board[r][c] = EMPTY;
        }
    }
/**
     * Resets the board to an initial position (without changing its size and other properties defined when the object was created)
     */
Resets the board to an initial position (without changing its size and other properties defined when the object was created)
Resets the board to an initial position ( without changing its size and other properties defined when the object was created )
reset()
    {
        this.#totalMoves = 0;
        this.#whiteMoves = true;
        this.#turnsRemaining = this.#cols * this.#rows;
        this.outcome = ONGOING;
        this.gameLog = new Array();
        this.board = new Array(this.#rows);
        for (let r = 0; r < this.#rows; r++) {
            this.board[r] = new Array(this.#cols);
            for (let c = 0; c < this.#cols; c++)
                this.board[r][c] = EMPTY;
        }
    }
reset ( ) { this . #totalMoves = 0 ; this . #whiteMoves = true ; this . #turnsRemaining = this . #cols * this . #rows ; this . outcome = ONGOING ; this . gameLog = new Array ( ) ; this . board = new Array ( this . #rows ) ; for ( let r = 0 ; r < this . #rows ; r ++ ) { this . board [ r ] = new Array ( this . #cols ) ; for ( let c = 0 ; c < this . #cols ; c ++ ) this . board [ r ] [ c ] = EMPTY ; } }
Resets the board to an initial position (without changing its size and other properties defined when the object was created)
Resets the board to an initial position ( without changing its size and other properties defined when the object was created )