IPVGO: Add optional board state argument to the go analysis functions (#1716)

This commit is contained in:
Michael Ficocelli
2024-10-27 20:31:06 -04:00
committed by GitHub
parent ecc2d92edb
commit 6df3dcdc82
11 changed files with 231 additions and 39 deletions
+10
View File
@@ -645,6 +645,16 @@ export function boardFromSimpleBoard(simpleBoard: SimpleBoard): Board {
);
}
/**
* Creates a Board object from the given simpleBoard string array
* Also updates the board object with the analytics (liberties/chains) from the simple board
*/
export const updatedBoardFromSimpleBoard = (simpleBoard: SimpleBoard): Board => {
const board = boardFromSimpleBoard(simpleBoard);
updateChains(board);
return board;
};
export function boardStateFromSimpleBoard(
simpleBoard: SimpleBoard,
ai = GoOpponent.Daedalus,