dist/wolfcage.dev.js
// Add the blocks to a row
Add the blocks to a row
Add the blocks to a row
_buildRow(row) {
    var col, i, oneIndex, ref, twoIndex, zeroIndex;
    for (col = i = 1, ref = this._boardNoCellsWide; (1 <= ref ? i <= ref : i >= ref); col = 1 <= ref ? ++i : --i) {
      zeroIndex = this._currentCells[row - 1][col - 1];
      if (zeroIndex === void 0) {
        zeroIndex = this._currentCells[row - 1][this._boardNoCellsWide];
      }
      oneIndex = this._currentCells[row - 1][col];
      twoIndex = this._currentCells[row - 1][col + 1];
      if (twoIndex === void 0) {
        twoIndex = this._currentCells[row - 1][1];
      }
      if (this._RuleMatcher.match(zeroIndex, oneIndex, twoIndex) === 0) {
        this._getCellHtml(row, col, false);
      } else {
        this._getCellHtml(row, col, true);
      }
    }
    return this._currentRow++;
  }
_buildRow ( row ) { var col , i , oneIndex , ref , twoIndex , zeroIndex ; for ( col = i = 1 , ref = this . _boardNoCellsWide ; ( 1 <= ref ? i <= ref : i >= ref ) ; col = 1 <= ref ? ++ i : -- i ) { zeroIndex = this . _currentCells [ row - 1 ] [ col - 1 ] ; if ( zeroIndex === void 0 ) { zeroIndex = this . _currentCells [ row - 1 ] [ this . _boardNoCellsWide ] ; } oneIndex = this . _currentCells [ row - 1 ] [ col ] ; twoIndex = this . _currentCells [ row - 1 ] [ col + 1 ] ; if ( twoIndex === void 0 ) { twoIndex = this . _currentCells [ row - 1 ] [ 1 ] ; } if ( this . _RuleMatcher . match ( zeroIndex , oneIndex , twoIndex ) === 0 ) { this . _getCellHtml ( row , col , false ) ; } else { this . _getCellHtml ( row , col , true ) ; } } return this . _currentRow ++ ; }
Add the blocks to a row
Add the blocks to a row
// Loop over each column in the current row // Wrap to the end of the row // when at the beginning // Wrap to the beginning of the row // when the end is reached // Determine whether the block should be set or not