Hello,
This is my first post, so it's a very ambitious idea. As in the title, it's a JavaScript API I have called TIB.js in which you write JavaScript code using the API and TI-BASIC source code is generated. It also emulates the behavior of what TI-BASIC would be generated as if it were run directly on the calculator.
Important: This is for TI-BASIC on the TI-83/TI-84+/TI-84+ CE models
Example:
Code:
You create a new program by calling the constructor, TIB(). It does throw an error if you provide more than 8 characters, since that is the character limit for program names. The math expression system is very modular to allow using math expressions to generate other ones for use in other sections of the code, like if you want to use a math expression at the start and end of your program if, say, it was a really big program.
complex() is how you create the objects TIB.js uses to represent complex numbers. export() simply generates the TI-BASIC source code.
The result of that example would be:
Code:
You can get really modular with
Code:
As of right now, I have finished the math-parsing system, and am currently working on the different commands in TI-BASIC.
This is my first post, so it's a very ambitious idea. As in the title, it's a JavaScript API I have called TIB.js in which you write JavaScript code using the API and TI-BASIC source code is generated. It also emulates the behavior of what TI-BASIC would be generated as if it were run directly on the calculator.
Important: This is for TI-BASIC on the TI-83/TI-84+/TI-84+ CE models
Example:
Code:
const prog = new TIB("MYPROG");
prog.sto(prog.add(5, prog.complex(6)), 'A');
prog.disp('A', true);
// 'true' tells TIB.js to treat 'A' like a variable and not pure text
prog.export();You create a new program by calling the constructor, TIB(). It does throw an error if you provide more than 8 characters, since that is the character limit for program names. The math expression system is very modular to allow using math expressions to generate other ones for use in other sections of the code, like if you want to use a math expression at the start and end of your program if, say, it was a really big program.
complex() is how you create the objects TIB.js uses to represent complex numbers. export() simply generates the TI-BASIC source code.
The result of that example would be:
Code:
5+6i->A
Disp AYou can get really modular with
Code:
const prog = new TIB("MYPROG");
let real = prog.add(5,6);
let imag = prog.complex(6);
let expr = real.divide(imag); // prog.divide(real, imag); works the exactly the same
prog.sto(expr, 'A');
prog.export();As of right now, I have finished the math-parsing system, and am currently working on the different commands in TI-BASIC.





