Introduction

BASIC-83 Beginners Tutorial

Introduction

By Ryan Cullan

Hello. My name is Ryan Cullan. I have been programming in BASIC-83 for about 3 years now. And as I think back I remember how hard it was to learn BASIC the hard way (on my own). I hope this helps all the other beginners who want to learn BASIC a little bit easier then I had it. OK? Now onto the programming!!

What is BASIC? Well, BASIC is a built in programming language on your Ti-83 calculator. BASIC can be used to program anything from little homework helpers to complex games. BASIC is a very simple language to learn because it is easy to understand. The genius behind the understanding is that most if it is in English. The commands have real word in them like "and", "or", and "Goto". It didn't take me long at all to pick BASIC language up and hopefully I will help you learn it even faster than I did.  So now lets have some fun!

The main things that we will be going over in these tutorials…

Tutorial 1:

The most basic commands you will ever see!

Tutorial 2:

getKey, The Graph screen, and how getKey can be used in animation!

Tutorial 3:

Home Screen Animation!

Tutorial 4:

The command For( and how it can be used!

Tutorial 5:

Your first real program (game)!


Tutorial 1
BASIC-83 Beginners Tutorial

Vol. 1

By Ryan Cullan

This is my first tutorial I have ever written so I hope its good!

What I tried to do in this tutorial was go over some of the most common and most used commands in the BASIC-83 language. So here we go!

You're first program:

Lets start off easy. How about a program that will clear the screen? Ok. First, press the PRGM key on your calc. Across the top bar you should see 3 headings, EXEC, EDIT, and NEW. Press your right arrow key 3 times, or until the heading NEW is highlighted. Press enter. Now you need to name your new program. You can name it whatever you want but for now we will call this CLEAR. So type in CLEAR with the alpha keys and then press enter.

This puts you now on the program edit screen. This is where you will be doing most of your work.  As you can see your program name is on the top of the screen, and your blinking cursor is below that, next to your cursor is a colon ( : ). The colon starts every new line in your program. So now lets make a program that clears the home screen. This is what your program edit screen should look like at this point:

Press your PRGM key again and you'll notice that when you press the PRGM key when you on the program edit screen it brings up a whole new menu. The menu you see here is all comands to use during programming. Press your right arrow once to get to a new header (I/O).  Scroll down a bit until you see "8: ClrHome". ClrHome is a command that clears the Home screen (the home screen is the screen u see when you start up, there are 2 different screens the home screen and the Graph screen but we'll get into that later · ).

Highlight ClrHome and press enter (or you can just press the 8 key, whatever you prefer).  This brings you back to the program edit screen. The program edit screen should look like this now:

:ClrHome

Now, hit 2nd and MODE to exit the program edit screen. Hit the PRGM key and you should see your program right on top. Highlight your program if it isn't already and press Enter. If there was any text on the home screen it isn't there anymore now that you cleared it using your program.

Now ask yourself. isn't it easier to hit the CLEAR button? Ya, it is. How about now we make a program that actually does something ok? Alright lets start.

Well make this program say something. How about have this program say "Hello!" Start like you did for our first program and name this one HELLO. Now on the program edit screen put these comands:

:ClrHome	(like from last time)

:Disp "HELLO"	(this is a new command. It is found under the I/O header after you hit the PRGM key on the programedit screen)

:Pause	(another new command. What this command does is it waits for the user to press the enter key before going on in the program)

Hopefully, your screen looks like this:

Ok, not that wasn't too painful was it? Well, let me explain some of those new comands.

:Disp "HELLO"

This isn't to hard. :Disp means display what is ever in the quotation marks after the command on the home screen. So in this case the word HELLO (or whatever you put in the quotation marks) will be displayed.

:Pause

This is easy. Pause just stops and waits for who ever is running the program to hit the ENTER key before moving on.

*A note on that last program:

You can only put 16 charters (letters) in one Disp command. If you put more the text will not show up on the screen because the screen is only so wide!

Simple right? Now just Run your program to see what you have done.

Can we get a little more advanced now? I think we  can. Lets make a program the will make you guess a number between 1 and 10 OK?

Here's the code. I will write the whole thing first and the n explain it later.

ClrHome

randInt(1,10)->A      ;just a note. -> is the same as the STO button on your calculator!

Disp "GUESS A NUMBER"

Input "GUESS=",B

If A=B

Then

Goto 1

Else

Goto 2

Lbl 1

Disp "YES!"

Pause

Stop

Lbl 2

Disp "WRONG"

Pause

Stop

Now take a step back and blink your eyes for a sec. Actually its not that difficult, really. Here let m e explain.

First, we'll go over the new commands:

randInt(1,10)->A    ;This tells you calc to pick a random number between 1 and 10 and then it gets stored to the variable A. You can change the  numbers in the parenthesis after the randInt( command to what ever you want and the calc will pick a random number between any of those numbers. Hopefully, you have had, or are having algebra so you know what variables are.

Input "GUESS=",B    ;This command waits for you to type in a number that gets stored to the variable B. The word GUESS is put in front of the number you input for the user of the program just to know exactly what they are putting in. In this case you are guessing a number between 1 and 10.

If A=B    ;kinda self-explanatory

Then       ; Again this is kinda self-explanatory

Goto 1    ; go to Label 1

Else        ; otherwise

Goto 2    ; go to label 2

This set of commands. Basically means that If A=B then go to label 1, otherwise go to label 2.

One of the reason's I like BASIC language so much,  is that it is in English and anyone can understand it.

And last but certainly not least:

Lbl 1      :this is a label. It is accessed by the command "Goto 1" It is just a mini section of a program that u can use for many purposes. In this case we used our 2 labels to display whether we were correct or wrong in  our guess.

Now I know after you run the program that you just made, you may thing "wow fun" but just being sarcastic. I know this is very basic and  not exactly the funniest game you can have on your calc. But if you are reading this you are just a beginner. And you have to start slow. I even started slower then you are if you are reading this. But I picked BASIC up quickly. And for all of you I will try to write as many journals as possible so I can help as many people as possible who want to learn BASIC for the TI-83. I hope to write about 1 journal a  month taking everyone from beginners BASIC all the way  up till advanced BASIC. But for now that's all folks! If you have anymore questions or any help at all don't hesitate to e-mail me at childofdakorn14@hotmail.com , Well I hope to see you all again in about a month!

Ryan Cullan

Coming up!

In Vol. 2.

getKey, Graph screen,  and how Getkey can be used in Animation


Tutorial 2
BASIC-83 Beginners Tutorial

Vol. 2

By Ryan Cullan

Ok, now this in this tutorial, we'll focus on some more easy and most common commands. Just some of the new commands are hard to understand if you are reading it for the first time so I will explain these new commands before I give you the code. In my last tutorial I told you that I would explain getKey, the Graph screen and how get key can be used in animation. So, here are the new commands:

getKey

This command sees if a key was pressed and if it finds that a key was pressed it takes that key's number and loads it to what every variable you store it to. You see each key has a certain number. Each key has its own number so the calculator can tell each key apart. To find each key's number it is in your Ti-83 manual. Or if you want to find each keys number a little more easier here is a small program that basically describes getKey.

ClrHome

Lbl 1

GetKey->K

If K=/0        ; we will use =/ as the not equals sign. See note #1.

Then

Goto 2

Else

Goto 1

Lbl 2

Disp K

Pause

Goto 1

Ok, all this program does is waits for a key to be pressed and stores the number of whatever key was pressed into K. Then we display K to see the number for the key we pressed. But since we didn't put some sort of exit command in our program there is only one way out. To get out you have to press the ON key to cause a break error to get out of this program. Hey, its not the best program but it shows how the getKey command is used.

Not #1:

For those of you who don't know what the not equals sign is, it is an equals sign with a slash through it. It basically means the opposite of equals, therefore not equals. Easy right?

Well now that you know how getKey works lets move on to more of the new commands.

The commands of the graph screen:

To set the window settings (the window settings are the maximum and minimum limits of the X and Y axes) use this:

Xmin->-47

Xmax->47

Ymin->-31

Ymax->31

This sets the maximum and minimum of the X and Y coordinates. I think you can understand. You are all smart people, right? Well, just for future reference, At this window setting, each block on the graph is equal to one. Which makes it just a little bit easier to work with.

Point settings:

Pt-On(

This is just an easy command that puts a point at the coordinates that you tell it to. For example:

Pt-On(5,5)

This would turn on the point (5,5) And for the other the opposite command:

Pt-Off(

After what I just explained I think you can figure what "Pt-Off(" does.

AxesOff and AxesOn

This turns the axes on the graph off and on. If they are on the axes show up on the graph and if they are off they just don't show up! That's all there is to that.

ClrDraw

This clears the graph if there is anything on like text or whatever on the graph screen.

Text(

This displays text on the graph screen ant the coordinates you put in. But using coordinates in "Text(" instead of using points on the axes as coordinates, they use blocks on the graph. For example, if you put in:

Text(1,1,"HI!"

This will put the word HI! in the UPPER LEFT-HAND corner. Had "Text(" use coordinates on the axes as points as to where to display the text, you word would have been in the center of the screen. Did you get it? I hope so if not you can e-mail me ( childofdakorn14@hotmail.com ).

I think that is all the new commands we have to learn for this program. This program coming up shows you just how animation will work o n the graph screen. Now I know that you will freak when you see this thing and be like "WHOA!" but you know all these commands now. So just take your time look it over several times if you have to and just pay attention and you will get it. Ok? All right are you ready? I am so lets go for it!

Oh ya WAIT! One thing I forgot that you don't know is the numbers for the keys.

2nd key=21

MODE=22

Left arrow=24

Up arrow=25

Right arrow=32

Ok, good thing I caught that huh? You could have gotten really lost on this one without it! Sorry! But now I think we are ready!

:

AxesOff

-47->Xmin:47->Xmax

-31->Ymin:31->Ymax

ClrDraw

0->X:0->Z

Lbl 1

If X>47 or X<-47

Goto 22

If Z>31 or Z<-31

Goto 22

Pt-On(X,Z)

Pt-On(X,Z+1)

Pt-On(X+1,Z+1)

Pt-On(X+1,Z)

getKey->K

If K=24

Goto L

If K=25

Goto U

If K=26

Goto R

If K=34

Goto D

If K=21

Goto 99

Goto 1

Lbl L

X-4->X

ClrDraw

Goto 1

Lbl R

X+4->X

ClrDraw

Goto 1

Lbl U

Z+4->Z

ClrDraw

Goto 1

Lbl D

Z-4->Z

ClrDraw

Goto 1

Lbl 99

getKey->K

If K=22

Goto S

Goto 99

Lbl S

ClrDraw

ClrHome

Disp "BYE"

Stop

Lbl 22

ClrDraw

Text(1,1,"TOO FAR")

Pause

0->X:0->Z

ClrDraw

Goto 1

Ok! This program is not that difficult. Just look at it and follow the labels and it  makes perfect sense! Run the program on your calc to see what it does. All it really does is moves a little square around the screen as you push the arrow keys. And if you go off the screen it resets the program. To get out of this program it uses not one but 2 key presses. You have to press the 2nd and then the MODE key (or if you press 2nd and MODE in the home screen it means QUIT so that's why I set it up that way). I hope you understand this tutorial and it can help you in your programming experiences!

I urge you to experiment with my programs and edit it to you liking so that you will learn all this just like I know it now. Believe me just play with mine and other people's programs and see what each section of the program actually does. Hey that's my secret behind how I learned! But any questions, my e-mail box is always open Childofdakorn14@hotmail.com

Coming up!

In Vol. 3

More commands for the home screen.


Tutorial 3
BASIC-83 Beginners Tutorial

Vol. 3

By: Ryan Cullan

Ok, in my third tutorial here we will go over some of the home screen animations. These are just a few commands that will help you in your programming to make games or whatever. So like in Vol. 2, this can get complicated at times so I will give you the commands before hand so you will understand what is going on.

Output(

This is a very easy command here. This displays text on the home screen that is pout at the coordinates that you put. But the way the coordinates that you put in are used is different. In these coordinates there are 16 spaces per lines and 7 lines on the screen. So you cant put more that 16 letters and/or spaces per line. Here's a cool program that will freak out your friends and it really shows you how Output( is used.

This is easy but it is different so I will tell you how I used Output( after I give you the program.

ClrHome

Output(4,3,"Menu("

Output(4,5,"min("

Output(4,6," Clear Entries"

Output(4,12,"edbd("

Output(4,14,"            "

Pause

Ok, now that was small enough.  But do you have any idea what that does? No? Well I'll explain it. This displays "Mem Cleared" on your screen and that really freaks your buddy's out if you give this program to them. What is does to show the lower case, is writes it like in Menu( you get the first 2 letters in Mem but you have to over write the second half of the Menu( command to get the word "Mem" it's a little confusing but I think you get it.

Now how about some animation's using Output(.

Well, with the last program I just showed you with Output( I think you can figure this one out pretty easily so here it is:

ClrHome

4->A

5->B

Lbl 1

Output(A,B,"*"

getKey ->K

If K=24

Goto L

If K=25

Goto U

If K=26

Goto R

If K=34

Goto D

If K=21

Goto 99

If K=0

Goto 1

Lbl L

ClrHome

B-1->B

Goto 1

Lbl U

ClrHome

A-1->A

Goto 1

Lbl R

ClrHome

B+1->B

Goto 1

Lbl D

ClrHome

A+1->A

Goto 1

Lbl 99

getKey->K

If K=22

Then

Goto 98

Else

Goto 99

Lbl 98

ClrHome

Disp "BYE!"

Pause

Stop

As you may notice this is the same program that we used in Vol. 2. Well, not exactly the same but it has been modified to animate the * on the home screen. But still, the same theory applies here as in the last tutorial. If you understood the last one (which I hope you did) you will defiantly understand this one. I hope it has helped you to program bigger and better. Well I guess that this is it for this tutorial, so keep practicing and keep programming. And as always my e-mail box is always open, childofdakorn14@hotmail.com, and if you have any questions let me know. I am always there at one time or another.

Coming in Vol. 4

Using For( in home screen animation


Tutorial 4
BASIC-83 Beginners Tutorial

Vol. 4

By: Ryan Cullan

Like I said in the end of Vol. 3, this tutorial will focus on primarily the command:

For(

And how it can be used in animations and games

Let me explain how For( is used first off. For( is used in a very different way from most other commands that we have learned before. Let me give you in example of how it is used:

ClrHome

For(Z,1,40)

Disp X

X+1->X

End

This program counts to 40 and then  stops. What For( does is it counts. Let me explain. For(Z,1,40) means start at Z starts a 1 and repeat the commands between For( and End (each time For( adds 1 to Z) until Z=40. I just put the Disp X to show that For( would repeat its commands into what you put in it. In this case we put 1 and 40 in. Now lets show you a really cool looking program that uses For(.

ClrHome

Lbl 1

Output(1,1,"* * * * * * * * "

Output(2,1,"*               "        <- 15 spaces here

Output(3,1,"               *"

Output(4,1,"*               "

Output(5,1,"               *"

Output(6,1,"*               "

Output(7,1,"               *"

Output(8,1," * * * * * * * *"

For(Z,1,60)

Output(1,1," * * * * * * * *"

Output(2,1," "

Output(2,16,"*"

Output(3,1,"*"

Output(3,16," "

Output(4,1," "

Output(4,16,"*"

Output(5,1,"*"

Output(5,16," "

Output(6,1," "

Output(6,16,"*"

Output(7,1,"*"

Output(7,16," "

Output(8,1,"* * * * * * * * "

Goto 1

End

This is just a fun little program that looks cool and could be used in the openings to games or other programs. I hope you liked this tutorial. See you in  Vol 5!

Coming up in Vol. 5:

Your first game!


Tutorial 5
BASIC-83 Beginners Tutorial

Vol. 1

By Ryan Cullan

Ok, my final Beginners tutorial. The next tutorial you will see from me is Regular/Advanced BASIC-83. But for now here is my last one! This looks like Tutorial 2 but is a game that you have to get within 5 points of the Majic Point. Is kinda corny but well get into better programming as we go on!

Here it is:

:

AxesOff

-47->Xmin:47->Xmax

-31->Ymin:31->Ymax

ClrDraw

0->X:0->Z

Lbl 1

If X>47 or X<-47

Goto 22

If Z>31 or Z<-31

Goto 22

Pt-On(X,Z)

Pt-On(X,Z+1)

Pt-On(X+1,Z+1)

Pt-On(X+1,Z)

randInt(-47,47)->A

randInt(-31,31)->B

If A÷X+5 or A÷X-5

Then

Goto E

End

If B÷Z+5 or B÷Z-5

Then

Goto E

End

getKey->K

If K=24

Goto L

If K=25

Goto U

If K=26

Goto R

If K=34

Goto D

If K=21

Goto 99

Goto 1

Lbl L

X-4->X

ClrDraw

Goto 1

Lbl R

X+4->X

ClrDraw

Goto 1

Lbl U

Z+4->Z

ClrDraw

Goto 1

Lbl D

Z-4->Z

ClrDraw

Goto 1

Lbl 99

getKey->K

If K=22

Goto S

Goto 99

Lbl S

ClrDraw

ClrHome

Disp "BYE"

Stop

Lbl 22

ClrDraw

Text(1,1,"TOO FAR")

Pause

0->X:0->Z

ClrDraw

Goto 1

Lbl E

ClrDraw

ClrHome

Disp "YOU DID IT!","","YOU FOUND THE ","MAJIC POINT!"

Pause

Stop

Well, thats it. My final beginners tutorial. If you have any questions or bugs to report then please e-mail me at Childofdakorn14@hotmail.com. Ok see ya later and look for me soon for more advanced tutorials!