mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +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
@@ -92,9 +92,9 @@ describe("Netscript Go API unit tests", () => {
|
||||
|
||||
describe("getGameState() tests", () => {
|
||||
it("should correctly retrieve the current game state", async () => {
|
||||
const board = ["OXX..", ".....", ".....", "...XX", "...X."];
|
||||
const board = ["OXX..", ".....", "..#..", "...XX", "...X."];
|
||||
const boardState = boardStateFromSimpleBoard(board, GoOpponent.Daedalus, GoColor.black);
|
||||
boardState.previousBoards = [["OX..", ".....", ".....", "...XX", "...X."]];
|
||||
boardState.previousBoards = ["OX.........#.....XX...X."];
|
||||
Go.currentGame = boardState;
|
||||
|
||||
const result = getGameState();
|
||||
|
||||
@@ -57,10 +57,10 @@ describe("Go board analysis tests", () => {
|
||||
it("identifies invalid moves from repeat", async () => {
|
||||
const board = [".X...", ".....", ".....", ".....", "....."];
|
||||
const boardState = boardStateFromSimpleBoard(board);
|
||||
boardState.previousBoards.push([".X...", ".....", ".....", ".....", "....."]);
|
||||
boardState.previousBoards.push([".X...", ".....", ".....", ".....", "....."]);
|
||||
boardState.previousBoards.push([".X...", ".....", ".....", ".....", "....."]);
|
||||
boardState.previousBoards.push(["OX...", ".....", ".....", ".....", "....."]);
|
||||
boardState.previousBoards.push(".X.......................");
|
||||
boardState.previousBoards.push(".X.......................");
|
||||
boardState.previousBoards.push(".X.......................");
|
||||
boardState.previousBoards.push("OX.......................");
|
||||
const validity = evaluateIfMoveIsValid(boardState, 0, 0, GoColor.white, false);
|
||||
|
||||
expect(validity).toEqual(GoValidity.boardRepeated);
|
||||
|
||||
Reference in New Issue
Block a user