Refactored Netscript with Acorns parser. Major rebalancing. Add TIX API. Add round(), purchaseServer().

This commit is contained in:
Daniel Xie
2017-07-13 11:54:29 -05:00
parent 378797e511
commit 222f75d55a
15 changed files with 696 additions and 305 deletions
+6
View File
@@ -50,4 +50,10 @@ function compareArrays(a1, a2) {
function printArray(a) {
return "[" + a.join(", ") + "]";
}
//Returns bool indicating whether or not its a power of 2
function powerOfTwo(n) {
if (isNaN(n)) {return false;}
return n && (n & (n-1)) === 0;
}