Author Topic: To compose a program that works both on 83+ Basic and 68k Basic  (Read 3085 times)

0 Members and 1 Guest are viewing this topic.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
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.
« Last Edit: March 18, 2013, 09:22:40 pm by blue_bear_94 »
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: To compose a program that works both on 83+ Basic and 68k Basic
« Reply #1 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.
In-progress: Graviter (...)

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: To compose a program that works both on 83+ Basic and 68k Basic
« Reply #2 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.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: To compose a program that works both on 83+ Basic and 68k Basic
« Reply #3 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?

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: To compose a program that works both on 83+ Basic and 68k Basic
« Reply #4 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.
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの