TI-BASIC (Round *) (Special Bonus Edition)

I’ve been thinking, and I realized it’d be nice to add another goal to the TI-BASIC series. So I’m adding a sample program.

About the program: It’s called ‘Guess!’ (I am really creative), and it’s been around since I was in the fifth grade, in one form or another. It consists of guessing a number from 1-100, and being told if it’s too big or too small, and then guessing again, and being told again, etcetera, until you guess the number.

Technical description: Before you make a program, it’s a really really really really really really really really good idea to know exactly what you want it to do. So here’s the ‘outline’ (remember that # and everything after it is a comment):

Guess! (GPL 2008 T. Macdonald) #Title and license (GPL is sort of like a Copyright)

Guess: #User guesses a number

Too big! #If the number’s too big

Too small! #If it’s too small

You win! #If the user guesses it

And that’s it. Believe it or not, the minute it took to write that saved a lot of wasted coding.

So let’s implement what we already know:

Disp "Guess!","","(GPL) 2008", "T. Macdonald"
#Note that going from the outline to the implementation there was a better idea--putting 'Guess!' and the GPL on separate lines.
Input "Guess:".G
#Oh no! We don't know how to make a random number!
#Oh no! We don't know how to say if the number is too big or too small!
#(That's why the tutorial's not done. Stay tuned.)

Share/Save/Bookmark

Leave a Reply