Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: Yeong on February 20, 2012, 09:29:36 pm

Title: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on February 20, 2012, 09:29:36 pm
ok. Many people got their Prizm through the CASIO event and I assume that many people are willing to try to program. :D
However, Casio Basic and Ti Basic are different. D:
So, I decided to write a really simple (not complicated) "conversion table" from TI-BASIC to Prizm BASIC! :D



1. Input/Output

TI-BASIC
Input Stuff
Input "DISPLAY", Stuff
Output(row,column,"DISPLAY")
Disp "CONTENT"

to Prizm BASIC
?→Stuff
"DISPLAY"?→Stuff
(Color) Locate column,row,"DISPLAY"
"CONTENT"

Also, I think it's a good idea to mention that while TI-84+SE has 16x8 homescreen available to use for program, Prizm has 21x7 homescreen available to use for program. Yes. One less row. D:
At least, Locate can have color stuff XD Oh. Color can be accessed by [SHIFT] [5] [5] [1] in program editor.



2. Loops

TI-BASIC
:If Condition
:Then
:Code
:Else
:Another Code
:End

For(Variable,Start_Num,End_Num(,Increment value))
:Stuffs
:End

While Condition:Code:End

Repeat Condition:Code:End

to Prizm BASIC
If Condition
:Then
:Code
:Else
:Another Code
:IfEnd

For Start_NumVariable To End_Num(Step Increment Value)
:Stuffs
:Next

While Condition:Code: WhileEnd

Do:Code:LpWhile Condition

It's worthy to mention that in Prizm BASIC, "Then" is must be used in If statement.
Also, Do-LpWhile loop loops until the condition is true, unlike Repeat!



3. =>
=> is really awesome to use! :D

=> is called "Jump condition" iirc, and its syntax is this:
Condition=>Condition if true[:Condition of false]

It's kinda like ? function in axe. Kinda.

So instead of all this jarble:
If A=3
Goto 1
Else
Goto 2
IfEnd

You can do this!
A=3=>Goto 1:Goto 2

=> can be found in [shift] [vars] [f3] [f3].



4. Strings

TI BASIC
sub(Str1,Start_from,how_many_chars)

to Prizm BASIC
StrMid(Str 1,Start_from,how_many_chars)



I'll add more later. :D
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Darl181 on February 20, 2012, 09:42:26 pm
Yeah it's kind of weird that you can't get at the bottom row, I guess it's because of the program inadvertently scrolling the screen or something.

I'm wondering if there's a kind of catalog help for the Prizm anywhere, I just looked around (including the official thingy at casio's site) and didn't see any :/
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on February 20, 2012, 09:44:54 pm
The only place I could think of is the Prizm manual(Hard to find some stuffs XP ) and cemetech prizm wiki which has 100+ commands documented so far.
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: DJ Omnimaga on February 21, 2012, 02:19:04 am
The bottom row was actually reserved for the menus. It kinda sucks though because it makes porting 83+/86 games even more of an hassle.

By the way I think Qwerty.55 was working on a similar tutorial before, it might be somewhere on the forums. However he stopped.
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Deep Toaster on February 21, 2012, 03:43:33 pm
Thanks TBO_Yeong! I got my calculator today and started playing around with programs immediately. This is a really useful topic. (I'd rate you up but I can't from where I am D:)
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on February 21, 2012, 05:48:27 pm
I forgot to add the color in Locate and Else. XD
Just added them.
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Deep Toaster on February 21, 2012, 07:38:47 pm
By the way, you know you can use [hr] to draw horizontal lines:
So you don't have to use [spoiler][/spoiler].
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on February 21, 2012, 09:21:44 pm

THAT was what I was looking for XD
Thanks
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on February 25, 2012, 09:27:17 pm
updated for => stuff.
I think this should go to tutorial eventually... :D
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: saintrunner on February 26, 2012, 09:30:19 pm
With the => do you have to use goto's? Or could you simply tell it to do something like Locate blahblablah?
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: ruler501 on February 26, 2012, 09:35:07 pm
For the Disp Command you just showed text in quotes but this wont work for variables all the time(It at least didnt work in my program but that may be my fault)
Also istn there some strange triangle thing for Disp then pause?
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: saintrunner on February 26, 2012, 09:37:24 pm
I know how to display, I was just asking about the => command. Also yes the triangle thing will act as a pause in most cases
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: ruler501 on February 26, 2012, 09:43:54 pm
Oh I wasnt responding to yours saintrunner and I think that the => command should work with anything I'll test it on calc in a minute
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: DJ Omnimaga on February 27, 2012, 12:36:48 am
Looks nice so far Yeong. When it reaches more progress, you should put it in the tutorials section with a link to this thread. :D
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: turiqwalrus on February 27, 2012, 12:05:34 pm
Looks nice so far Yeong. When it reaches more progress, you should put it in the tutorials section with a link to this thread. :D
we'd need a prizm-basic section, though... we only have prizm-C and prizm-general

Also, I'd be happy to help a bit with these tutorials, Yeong :D
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on February 27, 2012, 06:37:30 pm
With the => do you have to use goto's? Or could you simply tell it to do something like Locate blahblablah?
it can be any line. ;)
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Spenceboy98 on March 01, 2012, 05:51:02 pm
What is the PRIZM Basic equivalent to "Repeat" in TI-Basic?
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: parserp on March 01, 2012, 06:03:41 pm
What is the PRIZM Basic equivalent to "Repeat" in TI-Basic?
TI-Basic:
Repeat A

Prizm Basic:
While A=0
or:
While Not(A)

(in other words, there isn't a "Repeat" token in Prizm Basic. ;))
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Spenceboy98 on March 01, 2012, 06:13:19 pm
Code: [Select]
:Repeat pxl-Test(Ans,B)=2
How would I do this?
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: parserp on March 01, 2012, 06:31:36 pm
Code: [Select]
:Repeat pxl-Test(Ans,B)=2
How would I do this?
Well, first of all, pxl-Test returns either a 1 or a 0, so that loop would go forever. :P

If you wanted to do something like:
Repeat pxl-Test(Ans,B)=1 (which is the same as doing Repeat pxl-Test(Ans,B))

Then in Casio Basic, the code would look like this:
While pxl-Test(Ans,B)=0
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Spenceboy98 on March 01, 2012, 06:33:39 pm
What would happen if it equaled 2(the casio one)? Nevermind......
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: parserp on March 01, 2012, 06:37:12 pm
While pxl-Test(Ans,B)=/=2

EdIt: 1one1one p0st.
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Yeong on March 01, 2012, 06:46:45 pm
What is the PRIZM Basic equivalent to "Repeat" in TI-Basic?
I'm pretty sure I mentioned the alternative to Repeat Loop... O.o
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: Deep Toaster on March 01, 2012, 07:35:30 pm
If you mean a loop that checks at the end instead of at the beginning, use Do/LpWhile.

EDIT: It's all in the first post as Yeong said.
Title: Re: z80 TI-BASIC to PRIZM-BASIC: the BASIC (not the Game)
Post by: krazylegodrummer56 on March 01, 2012, 08:20:09 pm
AWSOME. *.* just what I wanted. :w00t: