Author Topic: Getting started in Casio-Basic? You can ask here.  (Read 79041 times)

0 Members and 1 Guest are viewing this topic.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: Getting started in Casio-Basic? You can ask here.
« Reply #105 on: October 19, 2011, 09:51:22 am »
a mistake that newbies usually make is to say some thing like: 1 -> Mat A[1,1]

when actually, you need to do this first to prevent a mem error: [[0][0]] -> Mat A

That creates a matrix. 1-> Mat A[1,1] does not create a matrix, so if it doesn't exist, you get a mem error.

Just thought i'd add that info, since a lot of BASIC progs have that problem.



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Getting started in Casio-Basic? You can ask here.
« Reply #106 on: October 20, 2011, 09:33:27 am »
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 columns
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline m1ac4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 106
  • Rating: +8/-0
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #107 on: October 20, 2011, 09:54:14 am »
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 columns
You are right, the syntax is {<rows>,<columns>} -> Dim Mat A.
It's also worth noting that the closing brackets at the end are optional (e.g [[0][0->Mat A).  It looks messier but it saves space.

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Getting started in Casio-Basic? You can ask here.
« Reply #108 on: October 20, 2011, 10:08:19 am »
I know there are ways to check for particular values in a matrix:
And display certain characters as a result:
Eg: a 5 x 5 matrix

Code: [Select]
[[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

Try and see what that says
« Last Edit: October 20, 2011, 10:09:17 am by Jonius7 »
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

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: Getting started in Casio-Basic? You can ask here.
« Reply #109 on: October 26, 2011, 04:45:10 am »
So has anyone figured out a way to have dynamic coloring? I mean for example if I got the code:

Code: [Select]
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

Pretty repetitive, right? O.O

Well I wonder if I can simply have something like the following pseudo code?
Code: [Select]
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

I forgot if we need the Then/EndIf when there's only one command to execute, since it has been so long since I last coded in Casio BASIC, but you get the idea. It might also be very helpful for tilemap generation.

Offline fxdev

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 177
  • Rating: +34/-6
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #110 on: October 26, 2011, 09:36:50 am »
Here's my solution (Replace '_' by ' '):

Code: [Select]
"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:" "

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: Getting started in Casio-Basic? You can ask here.
« Reply #111 on: October 26, 2011, 04:58:04 pm »
Wait I thought Locate had no word-wrapping? ???

EDIT Actually nvm I didn't notice the sub-string command stuff.

EDIT That works, thanks :D

EDIT THat string rotate command is just cool! O.O
« Last Edit: October 26, 2011, 08:55:34 pm by DJ_O »

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #112 on: October 27, 2011, 12:58:37 am »
I like how casio BASIC has all those string based functions similar to the high level ones found in languages such as C. I find them useful for heavily text based programs such simple CAS's and other math/science programs.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

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: Getting started in Casio-Basic? You can ask here.
« Reply #113 on: October 27, 2011, 01:24:19 am »
If it wasn't for the fact Locate lacks word-wrap, some of them could be very handy for scrolling.

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #114 on: December 08, 2011, 04:42:34 am »
I've been attempting to make a 'protected' program. I want people to be able to run it at any time but I want to prevent them from transferring the program(s) to other calculators. Unfortunately the built-in password function of the fx-9860 GII only prevents one from editing the program, not from transferring it. I've been trying to think of ways to make sure people can't transfer the program to others but so far to no avail.

The problem with an idea such as a password built in the program I modify for each person I give the program to is that the password will just be copied along with the program. Does anybody know a solution to this problem or whether or not there even is one?
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Getting started in Casio-Basic? You can ask here.
« Reply #115 on: December 08, 2011, 11:04:07 am »
Nope, sorry. i dunno how I could block a program. Send a backup will you send the totality of your ram, and thus what that's let's the program start.

You could with C progs, but for basic, i Think no.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #116 on: December 10, 2011, 02:39:05 am »
Unless you could call a C lib from a basic program then no. Such lib would need someway to individually identify the calculator it runs on such as for example checking a unique hardware id

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #117 on: January 18, 2012, 07:46:55 am »
In the guide of the Casio fx-9860 GII I found a list of data items that can be sent over communications. In regards to my previous question a data type that is missing from this list could be used to contain a unique password of sorts. The problem is that I haven't found any data types not present on this list. But since there is a list in the first place I am sure they must exist. Do any of you see a data item missing from this list?

Spoiler For Spoiler:
ALPHA MEM (alpha memory contents)
<CAPTURE> (Capture memory group)
CAPT n (Capture memory (1 to 20) data)
CONICS (Conics setting data)
DYNA MEM (Dynamic Graph functions)
EQUATION (Equation calculation coefficient values)
E-CON2 (E-CON2 setup memory contents)
FINANCIAL (Financial data)
<F-MEM> (Function memory group)
F-MEM n (Function memory (1 to 20) contents)
<G-MEM> (Graph memory group)
G-MEM n (Graph memory (1 to 20) contents)
<LISTFILE> (List file group)
LIST n (List memory (1 to 26 and Ans) contents)
LIST FILE n (List file memory (1 to 6) contents)
<MATRIX> (Matrix group)
MAT n (Matrix memory (A to Z and Ans) contents)
<PICTURE> (Picture memory group)
PICT n (Picture (graph) memory (1 to 20) data)
<PROGRAM> (Program group)
Program names (Program contents (All programs are listed.))
RECURSION (Recursion data)
SETUP (Setup data)
STAT (Stat result data)
<STRING> (String memory group)
STR n (String memory (1 to 20) data)
SYSTEM (OS and data shared by applications (clipboard, replay, history, etc.))
<S-SHEET> (Spreadsheet group)
Spreadsheet data names (Spreadsheet data (All spreadsheet data are listed.))
TABLE (Table data)
<V-WIN> (V-Window memory group)
V-WIN n (V-Window memory (1 to 6) contents)
Y=DATA (Graph expressions, graph draw/non-draw status, V-Window contents, zoom factors)

Original data can be found through the link down here, page 318 and 319.
http://education.casio.com/resource/pdfs/GII%20User%20Guide.pdf
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline sjjubb1989

  • LV0 Newcomer (Next: 5)
  • Posts: 1
  • Rating: +0/-0
    • View Profile
Re: Getting started in Casio-Basic? You can ask here.
« Reply #118 on: August 21, 2013, 07:20:04 pm »
Everytime I try to use LOCATE 1,1, "test" I never am able to. It always says "Syntax Error".

I upgraded my FX-9750GII to the FX-9860GII operating system, is this a possible reason that LOCATE always gives a syntax error?

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: Re: Getting started in Casio-Basic? You can ask here.
« Reply #119 on: August 22, 2013, 01:00:08 am »
Make sure there's no space between Locate 1,1, and "text". However I didn't code in Casio Basic for a year so I might not remember the real syntax well anymore. Anyway also make sure to select Locate from program commands, not type it letter by letter.