src/games/Bahab.js
/** Valid move for this game are pairs of coordinates (`[row, column]`), the first one being 
	where the moving piece starts, and the second one being where the moving piece ends.	
	*/
Valid move for this game are pairs of coordinates (`[row, column]`), the first one being
where the moving piece starts, and the second one being where the moving piece ends.
Valid move for this game are pairs of coordinates ( ` [ row column ] ` ) the first one being where the moving piece starts and the second one being where the moving piece ends .
function next(moves, haps, update) {
		raiseIf(haps, "Haps are not required (given ", haps, ")!");
		raiseIf(!moves, "Invalid moves ", moves, "!");
		var activePlayer = this.activePlayer(),
			move = moves[activePlayer];
		raiseIf(!Array.isArray(moves[activePlayer]), "Invalid moves ", moves, "!");
		var nextBoard = this.board.move(move[0], move[1]);
		if (update) {
			this.activatePlayers(this.opponent());
			this.board = nextBoard;
			return this;
		} else {
			return new this.constructor(this.opponent(), nextBoard);
		}
	}
function next ( moves , haps , update ) { raiseIf ( haps , "Haps are not required (given " , haps , ")!" ) ; raiseIf ( ! moves , "Invalid moves " , moves , "!" ) ; var activePlayer = this . activePlayer ( ) , move = moves [ activePlayer ] ; raiseIf ( ! Array . isArray ( moves [ activePlayer ] ) , "Invalid moves " , moves , "!" ) ; var nextBoard = this . board . move ( move [ 0 ] , move [ 1 ] ) ; if ( update ) { this . activatePlayers ( this . opponent ( ) ) ; this . board = nextBoard ; return this ; } else { return new this . constructor ( this . opponent ( ) , nextBoard ) ; } }
Valid move for this game are pairs of coordinates (`[row, column]`), the first one being
where the moving piece starts, and the second one being where the moving piece ends.
Valid move for this game are pairs of coordinates ( ` [ row column ] ` ) the first one being where the moving piece starts and the second one being where the moving piece ends .