mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-25 17:13:47 +01:00
28 lines
1.0 KiB
Markdown
28 lines
1.0 KiB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [GoAnalysis](./bitburner.goanalysis.md) > [getValidMoves](./bitburner.goanalysis.getvalidmoves.md)
|
|
|
|
## GoAnalysis.getValidMoves() method
|
|
|
|
Shows if each point on the board is a valid move for the player.
|
|
|
|
The true/false validity of each move can be retrieved via the X and Y coordinates of the move. `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.
|
|
|
|
**Signature:**
|
|
|
|
```typescript
|
|
getValidMoves(): boolean[][];
|
|
```
|
|
**Returns:**
|
|
|
|
boolean\[\]\[\]
|
|
|
|
## Remarks
|
|
|
|
RAM cost: 8 GB (This is intentionally expensive; you can derive this info from just getBoardState() )
|
|
|