mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-24 02:03:01 +02:00
Added ability to pass arguments into scripts
This commit is contained in:
@@ -32,4 +32,21 @@ function clearEventListeners(elemId) {
|
||||
|
||||
function getRandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
//Returns true if all elements are equal, and false otherwise
|
||||
//Assumes both arguments are arrays and that there are no nested arrays
|
||||
function compareArrays(a1, a2) {
|
||||
if (a1.length != a2.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < a1.length; ++i) {
|
||||
if (a1[i] != a2[i]) {return false;}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function printArray(a) {
|
||||
return "[" + a.join(", ") + "]";
|
||||
}
|
||||
Reference in New Issue
Block a user