>
Casio Progrmming for Dummies

This is the right place for you that want to learn how to make games for the 9850g.

This is the first lesson, and now you are going to lern the basic commands and how to use them.



Lesson 1

  • The basic of all casio games is to type different values in and save it as a letter (from A to Z + the theta symbol and the little r is accepted.) The program code could look like this: 15->A.

  • To set several letters as the same value:15->A~Z
    If you want to show the contence in a letter you´ll must use- Disp - (the little triangle). This will make a stop in the program, show the contence of the letter and types- Disp - in, right under the letter contence. Press EXE to continue.

  • To make a stop in the code so that you can input a valueand save it as a letter, use ? (?->A).



  • To type in text to the window you will need two (" ")ex."CASIO".
    When you wright this, the text will start at the upper left corner of the screen (coords 1,1)
    If you are using a calculator with color display, use Green or Orange command just befor the text to color it
    (ex. Green "CASIO").
    Now it´s possible to print the text on special coords (possible Xcoord 1-21 Ycoord 1-7).
    Then you will need to use the Locate command. ex. Locate 7,3,"CASIO"
    If you want to print the contence in a letter on special coords just type Locate 7,3,A_(here the contence of the letter is A).


  • You might wonder what the Lbl stands for. It´s a kind of bookmark or special location in the program.
    You can use the labels 0-9, A-Z, theta and r.
    To jump to the Label you´ll need the Goto command.
    ex.
    Lbl 0
    .
    .
    .
    Goto 0
  • While is another great command.
    ex.
    0->A
    While A=/=50
    A+1->A
    WhileEnd
    "END"
    First the program will set A to 0. Then the While command will loop while A is not equal to 50. The value in A will all the time plus itself. When A is 50 then the While loop will end and END will be printed on the screen.

  • Now the command that makes casio games fun to play, the Getkey.
    Every button accept for the AC button on the calculater has a special keycode. For example the EXE keycode is 31.

    Here are three different examples how to use the Getkey:
    Lbl 0
    If Getkey=31
    Then Locate 3,7,"CASIO"
    IfEnd
    Goto 0
    -------------OR-------------
    Lbl 0
    Getkey->G
    G=31=>Locate 3,7,"CASIO"
    Goto 0
    -------------OR-------------
    Lbl 0
    Getkey
    Ans=31=>Locate 3,7,"CASIO"
    Goto 0


  • Now another useful command, Ran#. This command randomizes a number betwean 0 and the inputed value
    (ex. 10Ran#; here betwean 0 and 10).
    To save the slotted number into a letter just add (10Ran#)->A.

    Now you should know about the most important cammands.
    Lets try and make a game that uses these commands.
    Name a new program "GUESSER" and type the following code:

    Int 100Ran#->A
    Lbl 0
    "GUESS, NUMBER 0-100"?->B
    B=A=>Goto 1
    B< A=>Locate 7,3,"BIGGER"_----------(The _ is the little triangle press:[shift][PRGM][f5])
    B>A=>Locate 7,3,"SMALLER"_
    ClrText------------------------------------(This clares all the text on the screen).
    Goto 0
    Lbl 1
    Green "CORRECT!"
    How to play: The calculater will slot a number betwean 0 and 100.
    Your mission is to guess the right number. Casio will tell you if the slotted number is smaller then the number you´d guessed.
    Finaly you´ll hopefully will guess the right number.

    If you want to add a counter that shows how many guesses you´d took befor you´d found the right number, just add the blue lines below.
    Int 100Ran#->A
    0->C
    Lbl 0
    C+1->C
    "GUESS, NUMBER 0-100"?->B
    B=A=>Goto 1
    B< A=>Locate 7,3,"BIGGER"_
    B>A=>Locate 7,3,"SMALLER"_
    ClrText
    Goto 0
    Lbl 1
    Green "CORRECT!"
    "NUMBER OF GUESSES:"
    C_


    END OF LESSON 1

    Lesson 2, light game programming