|
@@ -77,6 +77,13 @@ class CodeBox {
|
|
* @type {int}
|
|
* @type {int}
|
|
*/
|
|
*/
|
|
this.curr_stack = 0;
|
|
this.curr_stack = 0;
|
|
|
|
+ /**
|
|
|
|
+ * The current date
|
|
|
|
+ *
|
|
|
|
+ * This value is updated every tick
|
|
|
|
+ * @type {?Date}
|
|
|
|
+ */
|
|
|
|
+ this.datetime = null;
|
|
|
|
|
|
this.codeBoxDOM = document.getElementById(codeBoxID);
|
|
this.codeBoxDOM = document.getElementById(codeBoxID);
|
|
if(!this.codeBoxDOM) {
|
|
if(!this.codeBoxDOM) {
|
|
@@ -356,13 +363,13 @@ class CodeBox {
|
|
// TODO
|
|
// TODO
|
|
break;
|
|
break;
|
|
case "h":
|
|
case "h":
|
|
- // TODO
|
|
|
|
|
|
+ this.stacks[this.curr_stack].Push(this.datetime.getUTCHours());
|
|
break;
|
|
break;
|
|
case "m":
|
|
case "m":
|
|
- // TODO
|
|
|
|
|
|
+ this.stacks[this.curr_stack].Push(this.datetime.getUTCMinutes());
|
|
break;
|
|
break;
|
|
case "s":
|
|
case "s":
|
|
- // TODO
|
|
|
|
|
|
+ this.stacks[this.curr_stack].Push(this.datetime.getUTCSeconds());
|
|
break;
|
|
break;
|
|
// Code box manipulation
|
|
// Code box manipulation
|
|
case "g":
|
|
case "g":
|
|
@@ -389,6 +396,7 @@ class CodeBox {
|
|
|
|
|
|
Swim() {
|
|
Swim() {
|
|
const instruction = this.box[this.pointer.Y][this.pointer.X];
|
|
const instruction = this.box[this.pointer.Y][this.pointer.X];
|
|
|
|
+ this.datetime = new Date();
|
|
|
|
|
|
if(this.stringMode != 0 && dec(instruction) != this.stringMode) {
|
|
if(this.stringMode != 0 && dec(instruction) != this.stringMode) {
|
|
this.stacks[this.curr_stack].Push(dec(instruction));
|
|
this.stacks[this.curr_stack].Push(dec(instruction));
|