Added ability to pass arguments into scripts

This commit is contained in:
Daniel Xie
2017-06-16 21:53:57 -05:00
parent 7d6a94d7a1
commit 36eb7608d5
12 changed files with 586 additions and 499 deletions
+17
View File
@@ -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(", ") + "]";
}