# Gw Temp

## Tutorial - 'Guess the Number Game for Ti-83+ (Ti-Basic languag' by doktormartini

An item about Programming Languages posted on

### Blurb

A tutorial that shows newbies how to use TI-BASIC to create a simple guess-the-number game.

### Body

Hey all. Iâ€™m going to attempt to make a tutorial. This is my first one, so it make suck and have many spelling errors and stuff. Oh well. I will be teaching beginners of the Ti-Basic programming language how to make a cool guess the number game. Actually, itâ€™s not cool, but youâ€™ll feel good once you make it.
Turn the calculator on and go to PRGM then NEW. Name it something relevant like guess or number. Now we have to start with the code. Each command line starts with a colon (:) that is automatically put there for you. Thatâ€™s a plus. Most of the programming function can be found by pressing PGRM while working on the code, that is also a plus. Now for the code, after every piece of code I will put a description in [], so donâ€™t actually input it in the code unless you are dumb and want a syntax error. Most of us donâ€™t. Letâ€™s get to the code!!!J

:ClrHome [Clears whatever was on the screen previously.]
:randInt(1,50)Ã A [Press 2nd then 0(catalog) and find ranInt(. This picks a random number from 1-50 and puts it into variable A.]
:0Ã C [Makes the variable C equal 0. We will use this later to display the number of tries.]
:Disp â€œPick a numberâ€ [Says pick a number on the screen.]
:Disp â€œFrom 1 to 50â€ [Says from 1 to 50 on the screen]
:Lbl 11 [Creates a label to go to later.]
:Input B [Input your guess which is a variable, B.]
:If A=B [If the correct number equals your guess.]
:Then [Then do the following.]
:Disp â€œCorrectâ€ [Says correct on the screen.]
:Disp â€œTries:â€,C [The variable for number of tries, C, is displayed here.]
:Pause [Pauses the program. Push enter to continue.]
:ClrHome [Clears whatever is on the screen.]
:Stop [Ends the program and show the word DONE on the screen.]
:Else [Do this if A didnâ€™t equal B]
:If A>B [If the correct number is higher than your guess.]
:Then [Then do the following.]
:C+1=C [Adds 1 to C meaning that you took 1 try already.]
:Disp â€œToo Lowâ€ [Says too low on the screen telling you to guess a higher number.]
:Goto 11 [Goes to label 11 letting you guess again.]
:Else [Do this is A isnâ€™t greater than B.]
:If A :Then [Then do the following.]