Skip to content

Instantly share code, notes, and snippets.

@Karolis2011
Created November 12, 2020 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Karolis2011/8eb557386a75778af823b1180e71984c to your computer and use it in GitHub Desktop.
Save Karolis2011/8eb557386a75778af823b1180e71984c to your computer and use it in GitHub Desktop.
NTSL2++ example script
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