build/ludorum.js
/** The `next` game state is calculated by putting the mark of the active player in the square 
	indicated by the given move.
	*/
The `next` game state is calculated by putting the mark of the active player in the square
indicated by the given move.
The ` next ` game state is calculated by putting the mark of the active player in the square indicated by the given move .
function next(moves, haps, update) {
		raiseIf(haps, 'Haps are not required (given ', haps, ')!');
		var activePlayer = this.activePlayer(), 
			move = +moves[activePlayer];
		if (isNaN(move) || this.board.charAt(move) !== '_') {
			throw new Error('Invalid move '+ JSON.stringify(moves) +' for board '+ this.board +
				' (moves= '+ JSON.stringify(moves) +').');
		}
		var nextBoard = this.board.substring(0, move) + activePlayer.charAt(0) + this.board.substring(move + 1);
		if (update) {
			this.activatePlayers(this.opponent(activePlayer));
			this.board = nextBoard;
			return this;
		} else {
			return new this.constructor(this.opponent(activePlayer), nextBoard);
		}
	}
function next ( moves , haps , update ) { raiseIf ( haps , 'Haps are not required (given ' , haps , ')!' ) ; var activePlayer = this . activePlayer ( ) , move = + moves [ activePlayer ] ; if ( isNaN ( move ) || this . board . charAt ( move ) !== '_' ) { throw new Error ( 'Invalid move ' + JSON . stringify ( moves ) + ' for board ' + this . board + ' (moves= ' + JSON . stringify ( moves ) + ').' ) ; } var nextBoard = this . board . substring ( 0 , move ) + activePlayer . charAt ( 0 ) + this . board . substring ( move + 1 ) ; if ( update ) { this . activatePlayers ( this . opponent ( activePlayer ) ) ; this . board = nextBoard ; return this ; } else { return new this . constructor ( this . opponent ( activePlayer ) , nextBoard ) ; } }
The `next` game state is calculated by putting the mark of the active player in the square
indicated by the given move.
The ` next ` game state is calculated by putting the mark of the active player in the square indicated by the given move .