Refactored Netscript Hacknet Node library. Now an array called hacknetnodes[i] can be used to access hacknet nodes, and they can be upgraded with functions

This commit is contained in:
Daniel Xie
2017-05-25 07:18:34 -05:00
parent 6316cbae23
commit 8cd9e8954d
8 changed files with 196 additions and 69 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
* {type: "punc", value: "(" } // punctuation: parens, comma, semicolon etc.
* {type: "num", value: 5 } // numbers (including floats)
* {type: "str", value: "Hello World!" } // strings
* {type: "kw", value: "for/if/" } // keywords, see defs below
* {type: "kw", value: "for/if/..." } // keywords, see defs below
* {type: "var", value: "a" } // identifiers/variables
* {type: "op", value: "!=" } // operator characters
* {type: "bool", value: "true" } // Booleans
@@ -46,7 +46,7 @@ function Tokenizer(input) {
}
function is_punc(ch) {
return ",;(){}[]".indexOf(ch) >= 0;
return ",;(){}[].".indexOf(ch) >= 0;
}
function is_whitespace(ch) {