mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 07:07:50 +02:00
GO: Various changes before 2.6.0 (#1120)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { getBoardFromSimplifiedBoardState } from "../../../src/Go/boardAnalysis/boardAnalysis";
|
||||
import { opponents, playerColors } from "../../../src/Go/boardState/goConstants";
|
||||
import { getMove } from "../../../src/Go/boardAnalysis/goAI";
|
||||
import { setPlayer } from "@player";
|
||||
import { GoOpponent, GoColor } from "@enums";
|
||||
import { boardStateFromSimpleBoard } from "../../../src/Go/boardAnalysis/boardAnalysis";
|
||||
import { getMove } from "../../../src/Go/boardAnalysis/goAI";
|
||||
import { PlayerObject } from "../../../src/PersonObjects/Player/PlayerObject";
|
||||
import "../../../src/Faction/Factions";
|
||||
|
||||
@@ -14,24 +14,24 @@ setPlayer(new PlayerObject());
|
||||
describe("Go AI tests", () => {
|
||||
it("prioritizes capture for Black Hand", async () => {
|
||||
const board = ["XO...", ".....", ".....", ".....", "....."];
|
||||
const boardState = getBoardFromSimplifiedBoardState(board, opponents.TheBlackHand);
|
||||
const move = await getMove(boardState, playerColors.white, opponents.TheBlackHand);
|
||||
const boardState = boardStateFromSimpleBoard(board, GoOpponent.TheBlackHand);
|
||||
const move = await getMove(boardState, GoColor.white, GoOpponent.TheBlackHand);
|
||||
|
||||
expect([move.x, move.y]).toEqual([1, 0]);
|
||||
});
|
||||
|
||||
it("prioritizes defense for Slum Snakes", async () => {
|
||||
const board = ["OX...", ".....", ".....", ".....", "....."];
|
||||
const boardState = getBoardFromSimplifiedBoardState(board, opponents.SlumSnakes);
|
||||
const move = await getMove(boardState, playerColors.white, opponents.SlumSnakes);
|
||||
const boardState = boardStateFromSimpleBoard(board, GoOpponent.SlumSnakes);
|
||||
const move = await getMove(boardState, GoColor.white, GoOpponent.SlumSnakes);
|
||||
|
||||
expect([move.x, move.y]).toEqual([1, 0]);
|
||||
});
|
||||
|
||||
it("prioritizes eye creation moves for Illuminati", async () => {
|
||||
const board = ["...O...", "OOOO...", ".......", ".......", ".......", ".......", "......."];
|
||||
const boardState = getBoardFromSimplifiedBoardState(board, opponents.Daedalus);
|
||||
const move = await getMove(boardState, playerColors.white, opponents.Daedalus, 0);
|
||||
const boardState = boardStateFromSimpleBoard(board, GoOpponent.Daedalus);
|
||||
const move = await getMove(boardState, GoColor.white, GoOpponent.Daedalus, 0);
|
||||
|
||||
console.log(move);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user