Sort arrays
This commit is contained in:
parent
116daf3781
commit
ab6635d00e
@ -25,7 +25,7 @@ export function recursiveScan(ns: NS) {
|
|||||||
// Remove the current server
|
// Remove the current server
|
||||||
allServers.splice(allServers.indexOf("home"), 1)
|
allServers.splice(allServers.indexOf("home"), 1)
|
||||||
// Print all servers
|
// Print all servers
|
||||||
return allServers
|
return allServers.sort()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +40,7 @@ export function recursiveHackingRequired(ns: NS) {
|
|||||||
levels.push(ns.getServerRequiredHackingLevel(server))
|
levels.push(ns.getServerRequiredHackingLevel(server))
|
||||||
}
|
}
|
||||||
// remove duplicates
|
// remove duplicates
|
||||||
return [...new Set(levels)]
|
return [...new Set(levels)].sort()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user