Got it, I have a question. How would I do repeat loop, also how do I use the getkey command can I...

Code:

Getkey-> A
If A=some number
do something
IfEnd

If I use the if command do I have to close it with the IfEnd?
Also for each line do I have to have the : like in Ti basic?
That's exactly how getkey works, although you can also do


Code:

If Getkey=some number
Do something
IfEnd


When typing in notepad, you don't have to type the colons. The Prizm just uses them for display purposes. They aren't actually part of the program.
Here is my first program but it doesn't work, it gives me an error at.

Code:

If A=38

Could someone tell me why?
Program:

Code:

1->x
1->Y
While A/=31         : /= is doesn't equal
Getkey->A
If A=38
X-1->X
If A=27
X+1->X
Text X,Y,"X"
WhileEnd

Also the newline character shows up after every line is that supposed to happen?
Yep, the carriage return is supposed to appear. That actually does have meaning in the program, although it doesn't impact your code.

As for the If statement, I forgot to mention that you need a Then statement. So...:


Code:

If A=38
Then
do something
IfEnd


That *should* work.
Except the "X" won't move. How can I fix that?

Edit:
Never mind I figured it out.
Keep in mind that the TI-BASIC If optimizations you're trying to make don't work in Casio BASIC.

Also, try using Locate instead of Text. It's faster and it doesn't have those graph screen lines in the background.
Yes, I noticed and did that, but I deleted that useless program, and made a guessing game. I have been on my Prizm all day and am comfortable with Casio basic, but I am bored with the Basic, so I want to learn the C. For programming C is it on calc or on computer?
If it is on calc do I have to download anything to program C on the Prizm?
Also if it is on computer do I have to download anything?
You can't program in C on-calc*. There's no on-calc C compiler nor is there likely to be one anytime soon.

*Well, you technically could, but you'd have to compile on-comp, so it's pretty much useless.
calcman wrote:
Yes, I noticed and did that, but I deleted that useless program, and made a guessing game. I have been on my Prizm all day and am comfortable with Casio basic, but I am bored with the Basic, so I want to learn the C. For programming C is it on calc or on computer?
On the computer.
Quote:
If it is on calc do I have to download anything to program C on the Prizm?
Once you write the C programs on your computer and compile them, you plug in your Prizm as a mass storage device and load the programs that way.
Quote:
Also if it is on computer do I have to download anything?
Yes, the PrizmSDK that Tari and Jonimus have been working on. You can get the latest version here:

http://jonimoose.net/calcstuff/prizm/PrizmSDK.zip
Yes you could program in C on the Prizm technically because the BASIC IDE has all of the characters needed for C and the OS can export txt files, but it would be a very slow coding process.

But then again maybe we could could rebuild a modified version of gcc using gcc Neutral
It's not only possible but routine; that's how you compile a cross-compiler. Smile I notice that the PrizmSDK is well over 100MB though, so good luck tossing out enough stuff to fit it in about 5 or 6MB. Smile
KermMartian wrote:
It's not only possible but routine; that's how you compile a cross-compiler. Smile I notice that the PrizmSDK is well over 100MB though, so good luck tossing out enough stuff to fit it in about 5 or 6MB. Smile
Maybe if Casio ever makes an SD card version of the Prizm we can have an on calc C++ compiler. This could actually be handy for small projects or if I don't have a compiler available on my computer such as when I'm at school.
Or we could port something B. *steps away*

however, is so obsolete, you would have to do everything from scratch I would imagine. However, a simple B-like language would not be that foreign to C coders and could easily fit on a calc. However, as with all new/refreshed languages, it requires more thinking and thought than just saying 'sounds cool, lets start!' Razz

But, back on track, good luck programming C Smile
z80man wrote:
KermMartian wrote:
It's not only possible but routine; that's how you compile a cross-compiler. Smile I notice that the PrizmSDK is well over 100MB though, so good luck tossing out enough stuff to fit it in about 5 or 6MB. Smile
Maybe if Casio ever makes an SD card version of the Prizm we can have an on calc C++ compiler. This could actually be handy for small projects or if I don't have a compiler available on my computer such as when I'm at school.
This actually prompted me to do a full disassembly of my Prizm just now; I checked all the boards carefully, front and back, and no unpopulated SD card slot pads. Oh well.
So where should I start learning? I am completely new to C.
I usually prefer books as they are more informative than websites. I would recommend C++ Primer Plus 5th edition to start with. The book pretty much starts out teaching C then branches into more of the higher level C++ stuff. I like it as it is very descriptive of the code and takes a very broad approach to the language. You can find it here
I also prefer books to websites. I would have to recommend the old AP Computer Science textbook, C++ for You++. It is a C++ book. but the first, at least, half is C++ that could easily be C code. Also, at the beginning, it explains everything about how stuff works low-level. And it goes very in-depth about things such as: linked lists, hash tables, pointers, etc. Easily my favorite programming book. Smile
I don't really learn programming from either books or websites; once I had the basics of a few languages down, I find it far more valuable to look at, try, modify, break, fix, and understand existing code, then fill in the holes in my knowledge from online documentation than try to read up on all the concepts of a language, then start coding. That's just me, though.
I am borrowing a C++ book, from my friends dad, and am learning quickly, but still haven't written any C++ programs, how do I write them on the Prizm and them execute them?
Edit:
Also if you program it on the computer do you type in your code directly into the compiler?
calcman wrote:
I am borrowing a C++ book, from my friends dad, and am learning quickly, but still haven't written any C++ programs, how do I write them on the Prizm and them execute them?
Edit:
Also if you program it on the computer do you type in your code directly into the compiler?
No. You use a simple text editor like Notepad++ or Notepad or Programmer's Notepad, save your file as a .c source file (which is just plan text, like .txt), and then compile it. Your version of the SDK should have a folder called /projects/; copy the /projects/default/ folder to /projects/yourproject/, and put your source code in there. You'll make to modify the Makefile (again with a text editor) with the name of your file.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement