v0.34.5. Also adding webpack config and package-lock.json

This commit is contained in:
danielyxie
2018-02-24 16:55:06 -06:00
parent 85ccb294dd
commit 779ce25ae5
49 changed files with 5537 additions and 1475 deletions

View File

@@ -0,0 +1,37 @@
Netscript Miscellaneous
=======================
Comments
--------
Netscript supports comments using the same syntax as `Javascript comments <https://www.w3schools.com/js/js_comments.asp>`_.
Comments are not evaluated as code, and can be used to document and/or explain code::
//This is a comment and will not get executed even though its in the code
/* Multi
* line
* comment */
print("This code will actually get executed");
Javascript Math Module
----------------------
The `Javascript Math Module <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math>`_ is
supported in Netscript and is used in the same way::
numThreads = Math.floor(getServerRam("foodnstuff")[1] / 3.4);
Javascript Date Module
----------------------
The `Javascript Date Module <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date>`_ is supported in Netscript.
However, since the 'new' operator does not work in Netscript, only the Date module's static functions can be used:
* now()
* UTC()
* Parse()
* Maybe some others I don't know about
Example::
time = Date.now();