mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 00:04:22 +02:00
IPVGO: Record full history to avoid infinite ko capture loops on larger boards (#1299)
This commit is contained in:
committed by
GitHub
parent
2f7950b49c
commit
d9f04203cf
@@ -9,7 +9,7 @@ import {
|
||||
findLibertiesForChain,
|
||||
getAllChains,
|
||||
boardFromSimpleBoard,
|
||||
simpleBoardFromBoard,
|
||||
boardStringFromBoard,
|
||||
} from "../boardAnalysis/boardAnalysis";
|
||||
import { endGoGame } from "../boardAnalysis/scoring";
|
||||
import { addObstacles, resetCoordinates, rotate90Degrees } from "./offlineNodes";
|
||||
@@ -89,15 +89,12 @@ export function makeMove(boardState: BoardState, x: number, y: number, player: G
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only maintain last 7 moves
|
||||
boardState.previousBoards.unshift(simpleBoardFromBoard(boardState.board));
|
||||
if (boardState.previousBoards.length > 7) {
|
||||
boardState.previousBoards.pop();
|
||||
}
|
||||
|
||||
const point = boardState.board[x][y];
|
||||
if (!point) return false;
|
||||
|
||||
// Add move to board history
|
||||
boardState.previousBoards.unshift(boardStringFromBoard(boardState.board));
|
||||
|
||||
point.color = player;
|
||||
boardState.previousPlayer = player;
|
||||
boardState.passCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user