##################################################################### # Casio Calculator Programming Example Copyright T. Lynn 97/05/22 # # # # http://www.ex-parrot.com/~tom/calcs/calcs/encyc/calcexmp.txt # # # ##################################################################### # # # This is an example program to show the syntax of the commands # # documented in the Casio Calculator Encyclopaedia at: # # # # http://www.ex-parrot.com/~tom/calcs/calcs/encyc/index.html # # # # It is written in the Calculator Text Format (CTF), the specs # # for which can be found at Tom Wheeley's calculator site: # # # # http://www.tsys.freeserve.co.uk/casio/ctf.html # # # ##################################################################### @@ program ; This line tells any programs reading this file that ; what follows is a calculator program. Do not try to ; type this line into your calculator. ; ; A line such as @@ program "EXAMPLE" would mean ; that you should name the following program "EXAMPLE". ; ; A line such as @@ program 0 would mean that you ; should put the following program in program slot P0. ; ; The absence of a program name or slot as in this case ; indicates that you can put it anywhere or give it any ; name you want. "HELLO" ; Prints HELLO to the text screen. "WORLD" ; WORLD ? -> X ; Asks for an input value or expression and assigns ; it to the variable X. ; ; The -> symbol is either on a separate key or can be ; entered by pressing the [SHIFT] key followed by the ; [,] key. 4 * 5 = 20 => "CALC WORKS" ; Prints CALC WORKS if 4*5 = 20. 4 * 5 <> 20 => "CALC IS" ; If 4*5 is not equal to 20, it 4 * 5 <> 20 => "BROKEN!" ; prints CALC IS ; BROKEN! ; ; The <> symbol is represented on ; the calculator as an equals sign ; with a line through it. ; ; The => symbol is NOT the same as ; the -> symbol. If 4 * 5 = 20 ; Pretty self-explanatory I reckon. Then "CALC WORKS" ; Else "CALC IS" ; cfx-9x50s only. "BROKEN!" ; IfEnd ; "HELLO" ; Prints HELLO to the text screen. Goto 0 ; WORLD "GOODBYE" ; Lbl 0 ; Jumps past the "GOODBYE" with the "WORLD" ; Goto...Lbl. For 1 -> A To 9 Step 2 ; A becomes first 1, then 3, 5, 7, 9. A_ ; Display triangle thingy. Displays the ; value of A and waits for [EXE]. Next ; ; cfx-9x50s only. Isz A ; Adds 1 to the value of A. "NOT SKIPPED" ; Prints NOT SKIPPED to the text screen. 1 -> A ; Sets the value of A to 1. Dsz A ; Subtracts 1 from the value of A. "SKIPPED" ; This line is ignored, because the ; result of Dsz A was zero. Range -3, 3, 1, -2, 2, 1 ; Sets the graph axes to: ; ; X axis: -3 to 3 (marked every 1) ; Y axis: -2 to 2 (marked every 1) ; ; On cfx-9x50s, renamed as ViewWindow. Range 1,127,0,1,63,0 ; Sets the graph axes to the screen size. Range 1,95,0,1,63,0 ; Use this to get pixel-perfect graphics. ; Use 127 for widescreen calcs, 95 for ; non-widescreen calcs. Plot 1, 1 ; Plots a pair of points relative to the Plot 2, 2 ; graph axes and draws a line between Line ; them. F-Line 1, 2, 2, 1 ; Draws a line between points (1,2) and ; (2,1) relative to the graph axes. ; ; cfx-9x50s only. [[1,2],[3,4]] -> Mat A ; Assigns the values 1 2 to Matrix A. ; 3 4 ; ; fx9700s and later. {1,2,3,4} -> List 1 ; Assigns the values 1,2,3,4 to List 1. ; ; cfx-9x50s only. ##################################################################### # If there are any other commands which you don't understand or # # which you think should be included in this file, please email me # # at tom-calcs@ex-parrot.com. # #####################################################################