dist/Board.js
function getPiecesFromBoard(board) {
    var initialPieces = {
        white: [],
        black: []
    };
    return board.reduce(function (piecesRow, row) {
        return row.reduce(function (pieces, position) {
            if (Position.hasBlackPiece(position)) pieces.black = pieces.black.concat(position);else if (Position.hasWhitePiece(position)) pieces.white = pieces.white.concat(position);
            return pieces;
        }, piecesRow);
    }, initialPieces);
}
function getPiecesFromBoard(board) {
    var initialPieces = {
        white: [],
        black: []
    };
    return board.reduce(function (piecesRow, row) {
        return row.reduce(function (pieces, position) {
            if (Position.hasBlackPiece(position)) pieces.black = pieces.black.concat(position);else if (Position.hasWhitePiece(position)) pieces.white = pieces.white.concat(position);
            return pieces;
        }, piecesRow);
    }, initialPieces);
}
function getPiecesFromBoard ( board ) { var initialPieces = { white : [ ] , black : [ ] } ; return board . reduce ( function ( piecesRow , row ) { return row . reduce ( function ( pieces , position ) { if ( Position . hasBlackPiece ( position ) ) pieces . black = pieces . black . concat ( position ) ; else if ( Position . hasWhitePiece ( position ) ) pieces . white = pieces . white . concat ( position ) ; return pieces ; } , piecesRow ) ; } , initialPieces ) ; }
Takes a board and return white and black pieces.
Used to calculate score from a board.

returns { white: [{x,y}], black: [{x,y}] }
Takes a board and return white and black pieces . Used to calculate score from a board .