findSeqInRow(sideWhite, seqLength) {
		console.assert(seqLength <= this.winSequence && seqLength > 0);

		var row = 0;
		var count = 0;

		// Go over each row
		while (row < this.rows) {
			// Go over each sequence of winSequence cells (with overlaps)
			for (let col = 0; col <= this.cols - this.winSequence; col++) {
				// count the total value in this subsequence
				let sum = 0;
				let emptyCells = 0;
				for (let i = col; i < col + this.winSequence; i++) {
					let thisCell = this.board[row][i];
					sum += thisCell;
					if (thisCell === EMPTY) emptyCells++;
				}

				if (sum === seqLength * (sideWhite ? WHITE : BLACK))
					if (this.getTurnsRemaining(sideWhite) >= emptyCells)
						// only count this if the requested side has enough moves remaining to theoretically occupy this sequence
						count++;
			}
			row++;
		}

		return count;
	}
// Returns how many partial rows of seqLength length the requested side has which currently are, or can potentially be extended to winSequence length.

Returns how many partial rows of seqLength length the requested side has which currently are, or can potentially be extended to winSequence length.
Returns how many partial rows of seqLength length the requested side has which currently are or can potentially be extended to winSequence length .
findSeqInRow(sideWhite, seqLength) {
		console.assert(seqLength <= this.winSequence && seqLength > 0);
		var row = 0;
		var count = 0;
		while (row < this.rows) {
			for (let col = 0; col <= this.cols - this.winSequence; col++) {
				let sum = 0;
				let emptyCells = 0;
				for (let i = col; i < col + this.winSequence; i++) {
					let thisCell = this.board[row][i];
					sum += thisCell;
					if (thisCell === EMPTY) emptyCells++;
				}
				if (sum === seqLength * (sideWhite ? WHITE : BLACK))
					if (this.getTurnsRemaining(sideWhite) >= emptyCells)
						count++;
			}
			row++;
		}
		return count;
	}
findSeqInRow ( sideWhite , seqLength ) { console . assert ( seqLength <= this . winSequence && seqLength > 0 ) ; var row = 0 ; var count = 0 ; while ( row < this . rows ) { for ( let col = 0 ; col <= this . cols - this . winSequence ; col ++ ) { let sum = 0 ; let emptyCells = 0 ; for ( let i = col ; i < col + this . winSequence ; i ++ ) { let thisCell = this . board [ row ] [ i ] ; sum += thisCell ; if ( thisCell === EMPTY ) emptyCells ++ ; } if ( sum === seqLength * ( sideWhite ? WHITE : BLACK ) ) if ( this . getTurnsRemaining ( sideWhite ) >= emptyCells ) count ++ ; } row ++ ; } return count ; }
Returns how many partial rows of seqLength length the requested side has which currently are, or can potentially be extended to winSequence length.
Returns how many partial rows of seqLength length the requested side has which currently are or can potentially be extended to winSequence length .
// Go over each row
 // Go over each sequence of winSequence cells (with overlaps)
 // count the total value in this subsequence
 // only count this if the requested side has enough moves remaining to theoretically occupy this sequence
