mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 05:05:47 +01:00
IPVGO: Fix crash caused by malformed previous move formatting (#1360)
This commit is contained in:
parent
d9e8161a64
commit
fe3e8fb348
@ -615,9 +615,11 @@ export function boardFromBoardString(boardString: string): Board {
|
|||||||
// Turn the SimpleBoard string into a string array, allowing access of each point via indexes e.g. [0][1]
|
// Turn the SimpleBoard string into a string array, allowing access of each point via indexes e.g. [0][1]
|
||||||
const boardSize = Math.round(Math.sqrt(boardString.length));
|
const boardSize = Math.round(Math.sqrt(boardString.length));
|
||||||
const boardTiles = boardString.split("");
|
const boardTiles = boardString.split("");
|
||||||
const simpleBoardArray = Array(boardSize).map((_, index) =>
|
|
||||||
boardTiles.slice(index * boardSize, (index + 1) * boardSize).join(""),
|
// Split the single board string into rows of length equal to the board width
|
||||||
);
|
const simpleBoardArray = Array(boardSize)
|
||||||
|
.fill("")
|
||||||
|
.map((_, index) => boardTiles.slice(index * boardSize, (index + 1) * boardSize).join(""));
|
||||||
|
|
||||||
return boardFromSimpleBoard(simpleBoardArray);
|
return boardFromSimpleBoard(simpleBoardArray);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user