mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Quick fix to prevent division by 0
This commit is contained in:
parent
28bd5e1b30
commit
93f4c499d4
@ -167,7 +167,7 @@ export function ls(
|
|||||||
|
|
||||||
function postSegments(segments: string[], style?: any, linked?: boolean): void {
|
function postSegments(segments: string[], style?: any, linked?: boolean): void {
|
||||||
const maxLength = Math.max(...segments.map((s) => s.length)) + 1;
|
const maxLength = Math.max(...segments.map((s) => s.length)) + 1;
|
||||||
const filesPerRow = Math.floor(80 / maxLength);
|
const filesPerRow = Math.ceil(80 / maxLength);
|
||||||
for (let i = 0; i < segments.length; i++) {
|
for (let i = 0; i < segments.length; i++) {
|
||||||
let row = "";
|
let row = "";
|
||||||
for (let col = 0; col < filesPerRow; col++) {
|
for (let col = 0; col < filesPerRow; col++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user