-
-
Save Karolis2011/8eb557386a75778af823b1180e71984c to your computer and use it in GitHub Desktop.
NTSL2++ example script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calculator = { | |
expr: '', | |
res: 0, | |
draw() { | |
Term.clear() | |
Term.write('Expr: ' + this.expr, true, (data) => this.handleExpr(data)) | |
Term.write('\r\n\r\n') | |
Term.write('Res: ' + this.res) | |
}, | |
handleExpr(data) { | |
this.expr = data | |
this.res = eval(data) | |
this.draw() | |
} | |
} | |
calculator.draw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment