Site hosted by Angelfire.com: Build your free website today!
 
TBasic for Dummies
Lesson 7

    Getkey is probably one of the best commands for making games on the TI-82. It allows you to see what button the user hits. It's also fairly simple to use (If you have your manual). We will work with the example below.

Program Hi:
:lbl 1
:Getkey->K
:if K=105
:Then
:Disp "hi"
:End
:Goto 1
 
    Getkey will capture the key that is pressed... It won't wait for a key to be pressed so you have to loop it to check if a key is pressed. If a key ISN'T pressed it will return 0 as a value. Each key on the calculator has a set value (this is where you will need your book). On page 13-16 there is a chart of each keys value. You can use that and the If-Then statement to test to see what key is pressed. So for those of you who haven't tested the above program, everytime you hit enter (key 105) it will put HI on the screen. Another example of a cute small program!

QUIZ:
1. Key 25 is the...
A. Down Key
B. Up Key
C. Enter Key

2. Can you use the on key in your programs?
A. Yes
B. No

3. What pages are the programming section in your TI instruction book?
A. Chapter 13
B. Chapter 12
C. Chapter 11
D. Chapter 10

Back to Contents