forked from bitburner-official/bitburner-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BITNODE: IPvGO territory control strategy game (bitburner-official#934)
- Loading branch information
1 parent
81c499e
commit 653c0f3
Showing
67 changed files
with
7,842 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [analysis](./bitburner.go.analysis.md) | ||
|
||
## Go.analysis property | ||
|
||
Tools to analyze the IPvGO subnet. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
analysis: { | ||
getValidMoves(): boolean[][]; | ||
|
||
getChains(): (number | null)[][]; | ||
|
||
getLiberties(): number[][]; | ||
|
||
getControlledEmptyNodes(): string[]; | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [cheat](./bitburner.go.cheat.md) | ||
|
||
## Go.cheat property | ||
|
||
Illicit and dangerous IPvGO tools. Not for the faint of heart. Requires Bitnode 14.2 to use. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
cheat: { | ||
getCheatSuccessChance(): number; | ||
removeRouter( | ||
x: number, | ||
y: number, | ||
): Promise<{ | ||
type: "invalid" | "move" | "pass" | "gameOver"; | ||
x: number; | ||
y: number; | ||
success: boolean; | ||
}>; | ||
playTwoMoves( | ||
x1: number, | ||
y1: number, | ||
x2: number, | ||
x2: number, | ||
): Promise<{ | ||
type: "invalid" | "move" | "pass" | "gameOver"; | ||
x: number; | ||
y: number; | ||
success: boolean; | ||
}>; | ||
|
||
repairOfflineNode( | ||
x: number, | ||
y: number, | ||
): Promise<{ | ||
type: "invalid" | "move" | "pass" | "gameOver"; | ||
x: number; | ||
y: number; | ||
success: boolean; | ||
}>; | ||
|
||
destroyNode( | ||
x: number, | ||
y: number, | ||
): Promise<{ | ||
type: "invalid" | "move" | "pass" | "gameOver"; | ||
x: number; | ||
y: number; | ||
success: boolean; | ||
}>; | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [getBoardState](./bitburner.go.getboardstate.md) | ||
|
||
## Go.getBoardState() method | ||
|
||
Retrieves a simplified version of the board state. "X" represents black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet. (They are not territory nor open nodes.) | ||
|
||
For example, a 5x5 board might look like this: | ||
|
||
``` | ||
[ | ||
"XX.O.", | ||
"X..OO", | ||
".XO..", | ||
"XXO.#", | ||
".XO.#", | ||
] | ||
``` | ||
Each string represents a vertical column on the board, and each character in the string represents a point. | ||
|
||
Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\]. | ||
|
||
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. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
getBoardState(): string[]; | ||
``` | ||
**Returns:** | ||
|
||
string\[\] | ||
|
||
## Remarks | ||
|
||
RAM cost: 4 GB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [getOpponent](./bitburner.go.getopponent.md) | ||
|
||
## Go.getOpponent() method | ||
|
||
Returns the name of the opponent faction in the current subnet. "Netburners" \| "Slum Snakes" \| "The Black Hand" \| "Tetrads" \| "Daedalus" \| "Illuminati" | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
getOpponent(): opponents; | ||
``` | ||
**Returns:** | ||
|
||
opponents | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [makeMove](./bitburner.go.makemove.md) | ||
|
||
## Go.makeMove() method | ||
|
||
Make a move on the IPvGO subnet gameboard, and await the opponent's response. x:0 y:0 represents the bottom-left corner of the board in the UI. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
makeMove( | ||
x: number, | ||
y: number, | ||
): Promise<{ | ||
type: "invalid" | "move" | "pass" | "gameOver"; | ||
x: number; | ||
y: number; | ||
success: boolean; | ||
}>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| x | number | | | ||
| y | number | | | ||
|
||
**Returns:** | ||
|
||
Promise<{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }> | ||
|
||
a promise that contains if your move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended | ||
|
||
## Remarks | ||
|
||
RAM cost: 4 GB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) | ||
|
||
## Go interface | ||
|
||
IPvGO api | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface Go | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [analysis](./bitburner.go.analysis.md) | | { getValidMoves(): boolean\[\]\[\]; getChains(): (number \| null)\[\]\[\]; getLiberties(): number\[\]\[\]; getControlledEmptyNodes(): string\[\]; } | Tools to analyze the IPvGO subnet. | | ||
| [cheat](./bitburner.go.cheat.md) | | { getCheatSuccessChance(): number; removeRouter( x: number, y: number, ): Promise<{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }>; playTwoMoves( x1: number, y1: number, x2: number, x2: number, ): Promise<{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }>; repairOfflineNode( x: number, y: number, ): Promise<{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }>; destroyNode( x: number, y: number, ): Promise<{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }>; } | Illicit and dangerous IPvGO tools. Not for the faint of heart. Requires Bitnode 14.2 to use. | | ||
|
||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [getBoardState()](./bitburner.go.getboardstate.md) | <p>Retrieves a simplified version of the board state. "X" represents black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet. (They are not territory nor open nodes.)</p><p>For example, a 5x5 board might look like this:</p> | ||
``` | ||
[ | ||
"XX.O.", | ||
"X..OO", | ||
".XO..", | ||
"XXO.#", | ||
".XO.#", | ||
] | ||
``` | ||
<p>Each string represents a vertical column on the board, and each character in the string represents a point.</p><p>Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].</p><p>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.</p> | | ||
| [getOpponent()](./bitburner.go.getopponent.md) | Returns the name of the opponent faction in the current subnet. "Netburners" \| "Slum Snakes" \| "The Black Hand" \| "Tetrads" \| "Daedalus" \| "Illuminati" | | ||
| [makeMove(x, y)](./bitburner.go.makemove.md) | Make a move on the IPvGO subnet gameboard, and await the opponent's response. x:0 y:0 represents the bottom-left corner of the board in the UI. | | ||
| [passTurn()](./bitburner.go.passturn.md) | <p>Pass the player's turn rather than making a move, and await the opponent's response. This ends the game if the opponent passed on the previous turn, or if the opponent passes on their following turn.</p><p>This can also be used if you pick up the game in a state where the opponent needs to play next. For example: if BitBurner was closed while waiting for the opponent to make a move, you may need to call passTurn() to get them to play their move on game start.</p> | | ||
| [resetBoardState(opponent, boardSize)](./bitburner.go.resetboardstate.md) | <p>Gets new IPvGO subnet with the specified size owned by the listed faction, ready for the player to make a move. This will reset your win streak if the current game is not complete and you have already made moves.</p><p>Note that some factions will have a few routers on the subnet at this state.</p><p>opponent is "Netburners" or "Slum Snakes" or "The Black Hand" or "Daedalus" or "Illuminati",</p> | | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [passTurn](./bitburner.go.passturn.md) | ||
|
||
## Go.passTurn() method | ||
|
||
Pass the player's turn rather than making a move, and await the opponent's response. This ends the game if the opponent passed on the previous turn, or if the opponent passes on their following turn. | ||
|
||
This can also be used if you pick up the game in a state where the opponent needs to play next. For example: if BitBurner was closed while waiting for the opponent to make a move, you may need to call passTurn() to get them to play their move on game start. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
passTurn(): Promise<{ | ||
type: "invalid" | "move" | "pass" | "gameOver"; | ||
x: number; | ||
y: number; | ||
success: boolean; | ||
}>; | ||
``` | ||
**Returns:** | ||
|
||
Promise<{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }> | ||
|
||
a promise that contains if your move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended | ||
|
||
## Remarks | ||
|
||
RAM cost: 0 GB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [Go](./bitburner.go.md) > [resetBoardState](./bitburner.go.resetboardstate.md) | ||
|
||
## Go.resetBoardState() method | ||
|
||
Gets new IPvGO subnet with the specified size owned by the listed faction, ready for the player to make a move. This will reset your win streak if the current game is not complete and you have already made moves. | ||
|
||
Note that some factions will have a few routers on the subnet at this state. | ||
|
||
opponent is "Netburners" or "Slum Snakes" or "The Black Hand" or "Daedalus" or "Illuminati", | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
resetBoardState( | ||
opponent: "Netburners" | "Slum Snakes" | "The Black Hand" | "Tetrads" | "Daedalus" | "Illuminati", | ||
boardSize: 5 | 7 | 9 | 13, | ||
): string[] | undefined; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| opponent | "Netburners" \| "Slum Snakes" \| "The Black Hand" \| "Tetrads" \| "Daedalus" \| "Illuminati" | | | ||
| boardSize | 5 \| 7 \| 9 \| 13 | | | ||
|
||
**Returns:** | ||
|
||
string\[\] \| undefined | ||
|
||
a simplified version of the board state as an array of strings representing the board columns. See ns.Go.getBoardState() for full details | ||
|
||
## Remarks | ||
|
||
RAM cost: 0 GB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [go](./bitburner.ns.go.md) | ||
|
||
## NS.go property | ||
|
||
Namespace for Go functions. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
readonly go: Go; | ||
``` | ||
|
||
## Remarks | ||
|
||
RAM cost: 0 GB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.