mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
IPVGO: Fix scoring of very large open areas (#2464)
This commit is contained in:
committed by
GitHub
parent
00339a206c
commit
ba1c6f3818
@@ -116,10 +116,10 @@ export function evaluateMoveResult(board: Board, x: number, y: number, player: G
|
||||
export function getControlledSpace(board: Board) {
|
||||
const chains = getAllChains(board);
|
||||
const length = board[0].length;
|
||||
const whiteControlledEmptyNodes = getAllPotentialEyes(board, chains, GoColor.white, length * 2)
|
||||
const whiteControlledEmptyNodes = getAllPotentialEyes(board, chains, GoColor.white, 99)
|
||||
.map((eye) => eye.chain)
|
||||
.flat();
|
||||
const blackControlledEmptyNodes = getAllPotentialEyes(board, chains, GoColor.black, length * 2)
|
||||
const blackControlledEmptyNodes = getAllPotentialEyes(board, chains, GoColor.black, 99)
|
||||
.map((eye) => eye.chain)
|
||||
.flat();
|
||||
|
||||
|
||||
@@ -141,9 +141,7 @@ function getColoredPieceCount(boardState: BoardState, color: GoColor) {
|
||||
* Finds all empty spaces fully surrounded by a single player's stones
|
||||
*/
|
||||
function getTerritoryScores(board: Board) {
|
||||
const emptyTerritoryChains = getAllChains(board).filter(
|
||||
(chain) => chain?.[0]?.color === GoColor.empty && chain.length <= board.length * 2,
|
||||
);
|
||||
const emptyTerritoryChains = getAllChains(board).filter((chain) => chain?.[0]?.color === GoColor.empty);
|
||||
|
||||
return emptyTerritoryChains.reduce(
|
||||
(scores, currentChain) => {
|
||||
|
||||
Reference in New Issue
Block a user