<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [GoAnalysis](./bitburner.goanalysis.md)

## GoAnalysis interface

Tools to analyze the IPvGO subnet.

**Signature:**

```typescript
export interface GoAnalysis 
```

## Methods

<table><thead><tr><th>

Method


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[clearAllPointHighlights()](./bitburner.goanalysis.clearallpointhighlights.md)


</td><td>

Removes all highlights from the board.


</td></tr>
<tr><td>

[clearPointHighlight(x, y)](./bitburner.goanalysis.clearpointhighlight.md)


</td><td>

Removes the highlight color and text from the specified node.


</td></tr>
<tr><td>

[getChains(boardState)](./bitburner.goanalysis.getchains.md)


</td><td>

Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null`<!-- -->.

Takes an optional boardState argument; by default uses the current board state.

The data from getChains() can be used with the data from getBoardState() to see which player (or empty) each chain is

For example, a 5x5 board might look like this. There is a large chain \#1 on the left side, smaller chains 2 and 3 on the right, and a large chain 0 taking up the center of the board.

```
[
  [   0,0,0,3,4],
  [   1,0,0,3,3],
  [   1,1,0,0,0],
  [null,1,0,2,2],
  [null,1,0,2,5],
]
```


</td></tr>
<tr><td>

[getControlledEmptyNodes(boardState)](./bitburner.goanalysis.getcontrolledemptynodes.md)


</td><td>

Returns 'X' for black, 'O' for white, or '?' for each empty point to indicate which player controls that empty point. If no single player fully encircles the empty space, it is shown as contested with '?'. "\#" are dead nodes that are not part of the subnet.

Takes an optional boardState argument; by default uses the current board state.

Filled points of any color are indicated with '.'

In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center:

```
[
  "OO..?",
  "OO.?.",
  "O.?.X",
  ".?.XX",
  "?..X#",
]
```


</td></tr>
<tr><td>

[getLiberties(boardState)](./bitburner.goanalysis.getliberties.md)


</td><td>

Returns a number for each point, representing how many open nodes its network/chain is connected to. Empty nodes and dead nodes are shown as -1 liberties.

Takes an optional boardState argument; by default uses the current board state.

For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured!

```
[
  [-1, 5,-1,-1, 2],
  [ 5, 5,-1,-1,-1],
  [-1,-1, 4,-1,-1],
  [ 3,-1,-1, 3, 1],
  [ 3,-1,-1, 3, 1],
]
```


</td></tr>
<tr><td>

[getStats()](./bitburner.goanalysis.getstats.md)


</td><td>

Displays the game history, captured nodes, and gained bonuses for each opponent you have played against.

The details are keyed by opponent name, in this structure:

```
{
  <OpponentName>: {
    wins: number,
    losses: number,
    winStreak: number,
    highestWinStreak: number,
    favor: number,
    bonusPercent: number,
    bonusDescription: string,
  }
}
```


</td></tr>
<tr><td>

[getValidMoves(boardState, priorBoardState, playAsWhite)](./bitburner.goanalysis.getvalidmoves.md)


</td><td>

Shows if each point on the board is a valid move for the player. By default, analyzes the current board state. Takes an optional boardState (and an optional prior-move boardState, if desired) to analyze a custom board.

The true/false validity of each move can be retrieved via the X and Y coordinates of the move.

```js
const validMoves = ns.go.analysis.getValidMoves();
const moveIsValid = validMoves[x][y];
```
Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.

Also note that, when given a custom board state, only one prior move can be analyzed. This means that the superko rules (no duplicate board states in the full game history) is not supported; you will have to implement your own analysis for that.

The current valid moves for white can also be seen by simply calling `ns.go.analysis.getValidMoves(true)`<!-- -->.


</td></tr>
<tr><td>

[highlightPoint(x, y, color, text)](./bitburner.goanalysis.highlightpoint.md)


</td><td>

Adds a colored circle indicator to the specified point. These indicators are removed once a move is played.


</td></tr>
<tr><td>

[resetStats(resetAll)](./bitburner.goanalysis.resetstats.md)


</td><td>

Reset all win/loss and winstreak records for the No AI opponent.


</td></tr>
<tr><td>

[setTestingBoardState(boardState, komi, nextPlayerIsWhite)](./bitburner.goanalysis.settestingboardstate.md)


</td><td>

Starts a new game against the "No AI" opponent, and sets the initial board size, pieces, and offline nodes to the given board state. "X" represent black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet.


</td></tr>
</tbody></table>

