src/GameBoard.js
/**
 * Given a bounding box of the longest sequence, this function
 * will return a winner if the length of the sequence is greater
 * than or equal to `winLength`.
 * 
 * Otherwise undefined is returned.
 */
Given a bounding box of the longest sequence, this function
will return a winner if the length of the sequence is greater
than or equal to `winLength`.

Otherwise undefined is returned.
Given a bounding box of the longest sequence this function will return a winner if the length of the sequence is greater than or equal to ` winLength ` . Otherwise undefined is returned .
function filterWinner(boundingBox, consequentSymbolCountToWin) {
  if (!boundingBox) return; 
  let {minLeft, minTop, maxRight, maxBottom, dx, dy} = boundingBox;
  let count = 0;
  let winner = [];
  let ySign = maxBottom > minTop ? 1 : -1;
  let x = minLeft; let y = minTop;
  while (x != maxRight || y != maxBottom) {
    winner.push([x, y]);
    x += dx;
    y += dy;
  }
  if (minLeft !== maxRight || minTop !== maxBottom) {
    winner.push([maxRight, maxBottom]);
  }
  if (winner.length >= consequentSymbolCountToWin) {
    return winner;
  }
}
function filterWinner ( boundingBox , consequentSymbolCountToWin ) { if ( ! boundingBox ) return ; let { minLeft , minTop , maxRight , maxBottom , dx , dy } = boundingBox ; let count = 0 ; let winner = [ ] ; let ySign = maxBottom > minTop ? 1 : - 1 ; let x = minLeft ; let y = minTop ; while ( x != maxRight || y != maxBottom ) { winner . push ( [ x , y ] ) ; x += dx ; y += dy ; } if ( minLeft !== maxRight || minTop !== maxBottom ) { winner . push ( [ maxRight , maxBottom ] ) ; } if ( winner . length >= consequentSymbolCountToWin ) { return winner ; } }
Given a bounding box of the longest sequence, this function
 will return a winner if the length of the sequence is greater
 than or equal to `winLength`.
Given a bounding box of the longest sequence this function will return a winner if the length of the sequence is greater than or equal to ` winLength ` .
// No winner here.