Is there any way to change Javascript, Which I'm an expert of to Ti-84 + Basic? It would really help me with my program seeing I'm new to Ti-84 + Basic language? Any help would be greatly appreciated. Very Happy
It sounds like it is impossible. TI-BASIC is (compared to JS) very very limited. And what part of JS? Also alert(), document.innerHTML, and even much much much more functions that are not possible in BASIC. It is probably possible porting variables. And what about more-dimensional arrays? What about a kind of sleep() function? I guess JS is too complicated to port to BASIC.
As PT_ said, Javascript is far too complicated to simply transpile to TI-BASIC. The restrictions of TI-BASIC necessitate a strange programming style that, in my experience programming in Python and Java, I haven't seen anywhere else. You'll just need to pick it up by reading, and coding with, TI-BASIC.

However, as a first step to learning TI-BASIC commands, associating them with JS equivalents could be helpful. I can't help with this, because I don't know any JS.
For starters, any language that allows you to have quotes in strings can't be transpiled to TI Basic Wink
Well ok, thanks for telling me. This means I gotta study up for TI Basic! Shock
elfprince13 wrote:
For starters, any language that allows you to have quotes in strings can't be transpiled to TI Basic Wink

uhmmm, well you can put them in a string if you have the user input them... But then again, one would only really use quotes in strings to display specific messages, therefore, I think putting two apostrophes would look very similar. And can't this be done with dcs7? (storing a quotation mark and a store symbol to a string?) not too sure about this but I think I recall there being a command for that...
JavaScript is not only limited to quotes in a string, which is indeed possible with Hybrid Basic. But JS has so many more functions as BASIC, that it is almost impossible to port it. The main obstacle is not having functions, or use console.log(). Furthermore animations and alert() stuff. Next is having arrays like

Code:
test['bla'];
which is absolute impossible in BASIC. If you absolute need to compile a JS-file to BASIC, I'm willing to help, as much it is possible though.
I started to try and change it but your right some of the codes are almost impossible to transfer but you can make changes to make them similar but not exactly look the same. It's just gonna take a while to transfer if you know what I mean...
Hybrid BASIC is inherently not the same as BASIC. You can do virtually anything in BASIC *if you write an assembly library and put a wrapper around it*. For most applications this is not a helpful answer.

There are all sorts of relatively straightforward ways to encode higher level data structures and control flow operations into TI-Basic, including dictionaries and functions.
Well basic constructs in JS like

Code:

if(foo==true){
console.log("apples");
}else{
console.log("cow");
}

can be converted to something like

Code:

if f
then
disp "apples
else
disp "cow
end

Remeber that tibasic has only 27 variables, A-Z plus theta Wink
You can store data in lists too, btw.
I've just decided to try transfer. One problem though, I have to transfer 1360 lines of code... Confused Crying Shock
Have fun with this. Hope it will work out Wink
Thanks, hope your projects go good as well! Smile Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement