-One question I have is can we omit quotes at the end of Locate? In TI-BASIC you can do things such as Output(1,1,"HELLO WORLD instead of Output(1,1,"HELLO WORLD") as long as the next code is on a different line, but I was wondering if it was the same on Casio? That usually saved us some bytes of RAM."Locate" and "Text" seem to allow this, but it's bad practice and does not seem to work with the ":" command either. Actually, I have never used this. The few bytes you save get lost by using special characters.
-Also are there any assembly tools that allow us to run programs directly from the Storage memoryMaybe this is what you are looking for?
-Also how would we recall a picture from a program on the Prizm? I tried RecallPict 1 (after storing a pic with StorePict 1) and it does nothing... ???You could try clearing the screen first using "cls" and you should disable any background image with "BG-None". Unfortunately, there is no way to test if a picture exists - causing a memory error sometimes.
Ah ok, I guess it is different between both brand of calcs. On TI, we try to save every possible byte by using such optimization. It is even considered a good practice among us. The only time it should be avoided is with For() when it only contains an IF instruction that is often False, due to a TI-OS glitch. Does special characters actually take more space than the regular ones? I remember something similar on TI with lowercase letters.Quote-One question I have is can we omit quotes at the end of Locate? In TI-BASIC you can do things such as Output(1,1,"HELLO WORLD instead of Output(1,1,"HELLO WORLD") as long as the next code is on a different line, but I was wondering if it was the same on Casio? That usually saved us some bytes of RAM."Locate" and "Text" seem to allow this, but it's bad practice and does not seem to work with the ":" command either. Actually, I have never used this. The few bytes you save get lost by using special characters.
Does this allow copying individual programs to the RAM? Being forced to copy entire packages might not be something I want, especially when each program is 15 KB large.Quote-Also are there any assembly tools that allow us to run programs directly from the Storage memoryMaybe this is what you are looking for?
http://casiokingdom.org/modules.php?name=Downloads&d_op=viewdownloaddetails&cid=16&lid=542&ttitle=FX9860G_LOADER_2.00#dldetails
Nope, no luck. Here's my code (Casio Prizm OS 01.01.0200):Quote-Also how would we recall a picture from a program on the Prizm? I tried RecallPict 1 (after storing a pic with StorePict 1) and it does nothing... ???You could try clearing the screen first using "cls" and you should disable any background image with "BG-None". Unfortunately, there is no way to test if a picture exists - causing a memory error sometimes.
Cls
Vertical -3
StoPict 1
Cls
BG-None
RclPict 1
Basically I wanted to clear the screen, display a line at -3, Store the screen content in picture 1, clear the screen again, then re-display the picture 1 content again. Not an useful program, but it was for testing purpose since I'm experimenting with the language.
Does special characters actually take more space than the regular ones?As long as they're non-ASCII.
Does this allow copying individual programs to the RAM? Being forced to copy entire packages might not be something I want, especially when each program is 15 KB large.As far as I know, this copies any program within a *.g1m/*.g2m file into the user RAM.
Nope, no luck. Here's my code (Casio Prizm OS 01.01.0200):And if you go to RUN|MAT and enter "Cls:RclPict 1"? This will display the coordinate system with an additional vertical line on my fx-9750GII.Code: [Select]Cls
Vertical -3
StoPict 1
Cls
BG-None
RclPict 1
// Program: INIT
Cls
BG-None
AxesOff
Horizontal -1
Horizontal 1
StoPict 1
Cls
Vertical -1
Vertical 1
StoPict 2
// Program: TEST
Prog "INIT"
While 1
Cls:RclPict 1_ // '_' is the small triangle
Cls:RclPict 2_
WhileEnd
Actually I noticed something even worse: Cls doesn't do anythingIndeed, when "Cls" is followed by a loop, the screen won't be cleared immediately.
Cls
LabelOff
ViewWindow 1,127,0,1,63,0
For 1->I To 5
Cls
For 1->J To 31
SketchThick F-Line 1,2J,126,2J
Next
Next
Actually, this should fill the entire screen...Not really sure what you mean, but that seems weird. X.x
Are you overwriting the status bar? If not, then this must be a bug.
Incredible, the Prizm makes Casio-Basic even crappier!
My suggestion for all Casio people is: Don't buy the Prizm and migrate to TI - they have better BASIC! :w00t:True, but hopefully once it is fully hacked, we can do better with the color screen.
Reminds me of several people requesting an F-LineOff command to clear a line. But up to this day, there are only the PxlOff/PlotOff and Cls/ClrGraph commands to clear a pixel or the entire screen. If you only want to clear some portion, you have to stick to printing blank characters...Oh well that sucks :P . If you noticed in the menu of my Snake game the arrow is on a black background because that was the only way I could erase it. Originally it was a white background, but then I couldn't get rid of it when it moved. Also is there a way to draw large text on the graph screen like you could do in TI-BASIC.
Also is there a way to draw large text on the graph screen like you could do in TI-BASIC.
I know that. I'm wondering if I can make it the same size as homescreen text like in TI-BASIC text(-1,0,0,"Hello would draw Hello in the large font.QuoteAlso is there a way to draw large text on the graph screen like you could do in TI-BASIC.
The command "Text" works in graphics mode. It's part of the sketch menu (press [Shift] + [F4]).
First off how do I take user input. Such as numbers and strings.
ClrText
"_ "->Str 1
Locate 1,1,">> _"
Do:While Getkey // wait for key release
WhileEnd
Do:Getkey // wait for key press
LpWhile Not Ans
StrLeft(Str 1,StrLen(Str 1)-2)->Str 1 // remove underscore
Ans=44=>StrLen(Str 1)=>StrLeft(Str 1,StrLen(Str 1)-1)->Str 1 // [DEL]
Ans=61=>Str 1+" "->Str 1 // [.]
Ans=76=>Str 1+"A"->Str 1 // [X,theta,T]
Ans=66=>Str 1+"B"->Str 1 // [log]
...
Str 1+"_ "->Str 1
Locate 4,1,StrRight(Str 1,19)
LpWhile Ans=/=31 And StrLen(Str 1)<255 // [EXE]
StrLeft(Str 1,StrLen(Str 1)-2)->Str 1 // remove underscore
Prog "PARSE" // start parsing...
Second is use of matricies and lists. Mostly on referencing a single index in that matrix or list.
// EXPECT_SIZE... expected list size (>1)
// MAGIC_NUMBER... some special value
EXPECT_SIZE->List 1[1]
If Dim List 1=/=List 1[1]
Then "Data not found!"
Else If List 1[List 1[1]]=/=MAGIC_NUMBER
Then "Data corrupted!"
Else "Data loaded!"
IfEnd:IfEnd
Last off is drawing with statistics functions. I tried the example code on casiocalc, but I couldn't get it to run.
Question: Does the Prizm's Locate command support color commands (e.g. Green Locate 1,1,...)?
One nice tool would be a PRIZM program to txt converter and vice-versa for those who wants to program in Notepad. Personally I prefer programming on a calc rather than the computer, but some people prefer the opposite.Doesn't the OS already have that?
Go into the program menu and scroll the bar over until you see "Save As." Then simply connect to your computer and look in the programs folder.
This by default uses L1 and L2 to calculate a linear regression and pastes the resulting equation in Y1
LinReg (ax+b) Y1
How would I do this in Prizm-Basic?
I always thought a string was best for tilemapping. But I'm not sure yet what is the equivalent of the sub() for Casio Basic.Yeah I wasn't sure as well. I checked a tutorial on Planet Casio but it seemed to miss such command. Maybe StrMid as what m1ac4 says.
I have a question about regression calculations.
What I want to do is when I calculate a statistical regression in a program, I would like to automatically place the resulting equation in a Y= equation of my choice. What I would do in TI-Basic is this:Code: (TI-Basic) [Select]This by default uses L1 and L2 to calculate a linear regression and pastes the resulting equation in Y1
How would I do this in Prizm-Basic?
LinReg (ax+b) Y1
Graphs can be drawn, but I haven't experiemented with that yet in basic. There is also something called dynamic graphs which are supposed to move or something. Just from the graph menu I was able to get some interesting color effects not normaly availible in basic. Its also relativily fast. Faster than the 83+. :DCould you tell me how you did that by the way? I tried in the Dynamic Graphing app and couldn't find out how :/ You should explain step by step and tell me which key to press or something.
(http://img.removedfromgame.com/imgs/1-DispCap1.bmp)
Do you need help with getting that specific pattern in Dyna Graph, or just help with using Dyna Graph? It doesn't really look like this pattern was made in Dyna Graph, because I don't think it's supposed to move...Graphs can be drawn, but I haven't experiemented with that yet in basic. There is also something called dynamic graphs which are supposed to move or something. Just from the graph menu I was able to get some interesting color effects not normaly availible in basic. Its also relativily fast. Faster than the 83+. :DCould you tell me how you did that by the way? I tried in the Dynamic Graphing app and couldn't find out how :/ You should explain step by step and tell me which key to press or something.
(http://img.removedfromgame.com/imgs/1-DispCap1.bmp)
I've been working on making a program to demonstrate the abilities of graphs and how they can be used used in programs, but I still can't get the syntax right for changing the color of graphs. Otherwise I have every other function that I wanted to demonstrate in place. One way to draw graphs smoothly in a game is to use the command SimulOn which causes every graph to be drawn at the same time instead of separately.Would this help? http://ourl.ca/9185/174354 (http://ourl.ca/9185/174354)
Yeah I remember that. Anyway one idea I had for example would be if the Prizm supports X=, we could use 4 lines to form dungeon walls or something, although in some cases it might not be super practical, plus it would be slow.There is x= but I need to check if you can draw y= and x= at the same time. For something like that though I would recommend using the plot functions as though are probably faster. Graphs seem to be best for inequalities as they can do special color combinations. Dynamic graphs don't support inequalities but can quickly draw complicated animated effects one the the pre-rendering has finished. Also note that you can load a background image on all graph operations. I do have a pretty cool program already that uses dynamic graphs in which the camera quickly runs down a 3D tunnel. I'll post that soon once I clean it up a little.
It's possible. I tried drawing one line at every edge of the screen... It worked, but the colors made it look all rainbow-y :PYeah I remember that. Anyway one idea I had for example would be if the Prizm supports X=, we could use 4 lines to form dungeon walls or something, although in some cases it might not be super practical, plus it would be slow.There is x= but I need to check if you can draw y= and x= at the same time.
If Getkey=28 And PxlTest(64-B+1)=0
(the 64 is because I use PlotOn to place the pixel, making the Y-coordinate (the B variable in this case) inverted. Because the graph screen is 64 high this makes sure the coordinates are correct)
Then A->D:B->E:B+1->B
(D and E just remove the old dot image when it has moved)
IfEnd
try:Trying that gave me a syntax error on the last line... ???
Locate 4,4,"some text"
0->K
While K=0
Getkey -> K
If K=79
Then ClrText
WhileEnd
Locate 4,4,"some text"
0->K
While K=0
Getkey -> K
If K=79
Then ClrText
IfEnd
WhileEnd
the ability to use HEX codes to generate icons. Especially the last function got me jealous of TI-calc owners D:That's not an actual TI-BASIC feature. The program Doors CS makes it work when you open files using it, but in all other cases, you can't have an icon.
They are similar, but I really feel TI-BASIC is the better programming language because of the ability to wrap strings around the screenYou can do that in a complicated fashion with the quotation marks (e.g. "String that is more than 21 characters long"). Just not with Locate.
... having the ability to check a certain part of a string (Casio-BASIC would need to extract the symbol from the string, store it into a seperate string and compare it with the comparison stringThat is what StrCmp( is for. Actually, I'm not quite sure what you mean here.
StrCmp(StrMid(Str #,<index>,<length>),"String")=0
Where "String" is whatever I am testing for (either a string # or something like "A"). This would combine all of the steps and run much faster. It is somewhat of a handful but it works.
There is an additional square bracket at the beginning that is necessary. In Jonius7's example it would start like [[0,0,0,1][0,0 ...Oh yes, i've forgotten about that. I've forgotten quite a lot of casio basic i once knew.
Also, pokemonrules9 do you know about the variables theta and r? It took me a while to realize I could use them in programs and having those additional two can be useful.
There are other ways to create a matrix other than [[0][0]] -> Mat A, however, I have not programmed casio for 2 years and have forgotten. Something like Dim Mat A, or setting the number of rows and columnsYou are right, the syntax is {<rows>,<columns>} -> Dim Mat A.
[[5][5]]->Mat A
[[1,2,3,1,2][2,3,1,2,1][3,1,2,1,2][1,2,1,2,3][2,1,2,3,1]]->Mat A
For 1->A To 5
For 1->B To 5
Mat A[A,B] = 1 => Locate B,A, "O"
Mat A[A,B] = 2 => Locate B,A, "M"
Mat A[A,B] = 3 => Locate B,A, "N"
Next
Next
For 1->A To 10
Red Locate 1,1,"HELLO WORLD!"
Red Locate 1,2,"THIS IS A TEST"
Red Locate 1,3,"PROGRAM!"
Red Locate 1,4,"BUT IT TAKES"
Red Locate 1,5,"WAY TOO MUCH"
Red Locate 1,6,"BLEEPING SPACE"
Red Locate 1,7,"OPTIMIZE PLZ!"
Magenta Locate 1,1,"HELLO WORLD!"
Magenta Locate 1,2,"THIS IS A TEST"
Magenta Locate 1,3,"PROGRAM!"
Magenta Locate 1,4,"BUT IT TAKES"
Magenta Locate 1,5,"WAY TOO MUCH"
Magenta Locate 1,6,"BLEEPING SPACE"
Magenta Locate 1,7,"OPTIMIZE PLZ!"
Blue Locate 1,1,"HELLO WORLD!"
Blue Locate 1,2,"THIS IS A TEST"
Blue Locate 1,3,"PROGRAM!"
Blue Locate 1,4,"BUT IT TAKES"
Blue Locate 1,5,"WAY TOO MUCH"
Blue Locate 1,6,"BLEEPING SPACE"
Blue Locate 1,7,"OPTIMIZE PLZ!"
Cyan Locate 1,1,"HELLO WORLD!"
Cyan Locate 1,2,"THIS IS A TEST"
Cyan Locate 1,3,"PROGRAM!"
Cyan Locate 1,4,"BUT IT TAKES"
Cyan Locate 1,5,"WAY TOO MUCH"
Cyan Locate 1,6,"BLEEPING SPACE"
Cyan Locate 1,7,"OPTIMIZE PLZ!"
Green Locate 1,1,"HELLO WORLD!"
Green Locate 1,2,"THIS IS A TEST"
Green Locate 1,3,"PROGRAM!"
Green Locate 1,4,"BUT IT TAKES"
Green Locate 1,5,"WAY TOO MUCH"
Green Locate 1,6,"BLEEPING SPACE"
Green Locate 1,7,"OPTIMIZE PLZ!"
Yellow Locate 1,1,"HELLO WORLD!"
Yellow Locate 1,2,"THIS IS A TEST"
Yellow Locate 1,3,"PROGRAM!"
Yellow Locate 1,4,"BUT IT TAKES"
Yellow Locate 1,5,"WAY TOO MUCH"
Yellow Locate 1,6,"BLEEPING SPACE"
Yellow Locate 1,7,"OPTIMIZE PLZ!"
Next
For 1->A To 10
For 1->B To 6
If B=1
Then
<code to set color to Red>
EndIf
If B=2
Then
<code to set color to Magenta>
EndIf
If B=3
Then
<code to set color to Blue>
EndIf
If B=4
Then
<code to set color to Cyan>
EndIf
If B=5
Then
<code to set color to Green>
EndIf
If B=6
Then
<code to set color to Yellow>
EndIf
<color set> Locate 1,1,"HELLO WORLD!"
<color set> Locate 1,2,"THIS IS A TEST"
<color set> Locate 1,3,"PROGRAM!"
<color set> Locate 1,4,"BUT IT TAKES"
<color set> Locate 1,5,"WAY TOO MUCH"
<color set> Locate 1,6,"BLEEPING SPACE"
<color set> Locate 1,7,"OPTIMIZE PLZ!"
Next
Next
"HELLO WORLD!________
_THIS IS A TEST______
_PROGRAM!____________
_BUT IT TAKES________
_WAY TOO MUCH________
_BLEEPING SPACE._____
_OPTIMIZE PLZ!_______
_"->Str 1
ClrText:0->I
Do:I+1->I:I>7=>1->I
For 1->J To 7
I=1=>Black Locate 1,J,Str 1
I=2=>Blue Locate 1,J,Str 1
I=3=>Red Locate 1,J,Str 1
I=4=>Magenta Locate 1,J,Str 1
I=5=>Green Locate 1,J,Str 1
I=6=>Cyan Locate 1,J,Str 1
I=7=>Yellow Locate 1,J,Str 1
StrRotate(Str 1,21)->Str 1
Next
LpWhile Getkey=/=47
ClrText:" "