Jump to content



Photo
- - - - -

Casio Basic Tutorial


  • Please log in to reply
15 replies to this topic

#1 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 15 June 2003 - 03:14 PM

I havent been able to work with this in a while but now I'm back at it.
Part 9: Input Basics

In any game you will want to get information from the player, otherwise they might as well be watching a movie.  The simplest way to get input from the user is to use the ? command.

Syntax: ?->(Variable)
Description: this command causes a ? to appear on the screen, execution pauses until the user enters data and hits [EXE], then the data is put into the variable.  This is a good way to ask yes or no questions, with the user having to enter 1 for yes and 0 for no.

Another way you can use the ? command is to put a prompt before it:  ?Continue (1=YES 0=NO)??->C
This causes the text to be displayed with a ? after it and waits for data.

Part 10: Key Input

In some games you will want to know what key the user is pressing, to do this you must use the Getkey command.

Syntax:  Getkey->(variable) or if Getkey=(key number)
Description: Getkey returns a different value for each key pressed, if no key is pressed then it returns 0, here is a simple program used to display the value of a key.

Lbl 1
Locate 1,1,Getkey
Goto 1

The only key which does not return a value is AC/On.


Part 11: Example Program 1

To better help you understand the first few lessons I have written a sample program so you can see how everything works.

Lbl 0
ClrText
Locate 9,4,"CATCH"
Locate 1,7,"BY: JAKE FINLEY"
Do
LpWhile Getkey<>31
ClrText
For 1->T To 7
Locate 15,T,"I"
Next
7->A
-1->S
0->V
Locate 16,1,"POINTS"
Lbl r
Isz S
Locate 16,2,S
1->r
Int 14Ran#+1->o
Lbl 1
Locate o,r,"o"
Locate A,7,"> <"
Locate o,r," "
Locate A,7,"   "
Getkey=27=>A<12=>A+1->A
Getkey=38=>A>1=>A-1->A
Isz r
r=7=>o>=A And o<=A+2=>A+1->o
r=8=>o=A+1=>Goto r
r=8=>Goto 2
If Getkey=79
Then Locate 16,4,"VORTEX"
1->V
IfEnd
V=1=>o<A+1=>Isz o
V=1=>o>A+1=>Dsz o
Goto 1
Lbl 2
ClrText
Locate 7,4,"GAME OVER"
Locate 1,7,"SCORE:"
Locate 8,7,S


#2 Guest_Bytefish Productions_*

Guest_Bytefish Productions_*
  • Guests

Posted 15 June 2003 - 03:23 PM

Thanks Jake. :greengrin:

#3 Bob Vila

Bob Vila

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 768 posts
  • Gender:Male
  • Location:USA

  • Calculators:
    FX 1.0+ : CFX-9850 GB Plus : TI-81

Posted 15 June 2003 - 05:06 PM

very good, glad to see that you are posting them again :)

#4 PJay

PJay

    Casio Freak

  • Members
  • PipPipPipPip
  • 260 posts
  • Gender:Male

  • Calculators:
    Casio fx-991ES Plus

Posted 23 August 2003 - 02:49 PM

What's "o" ? :unsure:

#5 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 05:28 PM

oops, that should be a "o" (theta)

#6 PJay

PJay

    Casio Freak

  • Members
  • PipPipPipPip
  • 260 posts
  • Gender:Male

  • Calculators:
    Casio fx-991ES Plus

Posted 23 August 2003 - 05:34 PM

oops, that should be a "o" (theta)

"o" or "theta" ? :unsure:

#7 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 05:36 PM

I edited the code so that it right.

#8 PJay

PJay

    Casio Freak

  • Members
  • PipPipPipPip
  • 260 posts
  • Gender:Male

  • Calculators:
    Casio fx-991ES Plus

Posted 23 August 2003 - 05:38 PM

"theta" = <span class=Alpha' /> [^] :hammer:
Yes ? :unsure:

#9 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 05:48 PM

correct, all the "o" are theta and the little "r" are <span class=Alpha' /> <span class=VARS' />

#10 PJay

PJay

    Casio Freak

  • Members
  • PipPipPipPip
  • 260 posts
  • Gender:Male

  • Calculators:
    Casio fx-991ES Plus

Posted 24 August 2003 - 04:29 AM

Your program doesn't work Posted Image :blink:

#11 ross8653

ross8653

    Casio Addict

  • Members
  • PipPipPip
  • 96 posts
  • Location:over the river and through the woods
  • Interests:paintball

  • Calculators:
    9850 fx2.0

Posted 24 August 2003 - 04:49 AM

you can add this little nugget from my little doc

if you want to find out what number button (1-9) someone presses you can use this function

(after user input "getkey -> x")
abs (int (x/10)-8)+3(10frac (x/10)-2)

note this doesn't prevent, or take into play if the user pushes a different key than 1-9 but this is used if you have games like my "whack it" where the ingame buttons are 1-9

also crimson are you gonna talk about getkey priority?
http://perso.wanadoo...ents/getkey.txt

#12 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 24 August 2003 - 12:35 PM

you know, I hadn't planned on it but I might, obviously I will explain that only one keypress registers at a time.

@PJ, I know it works because I programed it right on my calc and ran it, if there is a problem either you typed something wrong or there was some problem getting it from the FA-123 to here (like the o ~ a thing) but I dont see such a problem. if you could tell me what kind of error it is and where it happens then I may be able to help you.

#13 PJay

PJay

    Casio Freak

  • Members
  • PipPipPipPip
  • 260 posts
  • Gender:Male

  • Calculators:
    Casio fx-991ES Plus

Posted 29 August 2003 - 10:46 AM

Can you send your program (Part 11: Example Program 1) to me (*.cat) ? :unsure:

#14 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 29 August 2003 - 12:27 PM

shure.

#15 PJay

PJay

    Casio Freak

  • Members
  • PipPipPipPip
  • 260 posts
  • Gender:Male

  • Calculators:
    Casio fx-991ES Plus

Posted 30 August 2003 - 12:04 PM

shure.

To my email ? :unsure:

#16 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 30 August 2003 - 12:25 PM

yeah, I need a little time though, I'm at my moms and I dont have it with me.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users