Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: blue_bear_94 on March 18, 2013, 09:20:19 pm

Title: To compose a program that works both on 83+ Basic and 68k Basic
Post by: blue_bear_94 on March 18, 2013, 09:20:19 pm
So the challenge is to compose a program that works both on 83+ Basic and 68k Basic, in similar fashions. The example below clears the screen and prints "Hello World!" (This is only the body):
Code: [Select]
If sin(1)=.841470984808
ClrHome
CLRIO
Disp "Hello World!"

Edit: sin(1) is equal to .841470984808 on the 83/84+, due to it comparing only ten significant figures, but these two values are different on a CAS calc such as the TI-89. So if you have an 83/84+, the program runs ClrHome; otherwise, it runs ClrIO (the expression CLRIO is treated as the product of five variables on the 83+ but the ClrIO command on the 68k). The final line is identical for both models.
Title: Re: To compose a program that works both on 83+ Basic and 68k Basic
Post by: leafy on March 19, 2013, 01:37:07 am
(the expression CLRIO is treated as the product of five variables on the 83+ but the ClrIO command on the 68k).
Well, that's kinda cheating.
Title: Re: To compose a program that works both on 83+ Basic and 68k Basic
Post by: Streetwalrus on March 19, 2013, 04:42:16 am
The problem is that both calcs use different token sets and prog formats so you'd still have to convert them with a comp.
Title: Re: To compose a program that works both on 83+ Basic and 68k Basic
Post by: DJ Omnimaga on March 19, 2013, 01:30:50 pm
Yeah true. THe best thing would be if there was some token converter somewhere that replaced ClrIO with ClrHome or vice-versa.

Also are commands on 68K calcs case-sensitive?
Title: Re: To compose a program that works both on 83+ Basic and 68k Basic
Post by: blue_bear_94 on March 19, 2013, 07:59:18 pm
Yeah true. THe best thing would be if there was some token converter somewhere that replaced ClrIO with ClrHome or vice-versa.

Also are commands on 68K calcs case-sensitive?

Well, I was ignoring tokens, and commands are not case-sensitive on the 68k.