Guess the Number
Name: Guess the Number Author: TI-Basic Developer Download: NumberGuess.zip Compatibility: Parent page not set File Size: 215 Bytes |
Try to guess the number, and see how many tries it takes you. |
Want to update this page?
- Upload new files to provide up-to-date versions of your program;
- or Edit the content of this page to provide up-to-date information about your program.
A moderator will only process these changes if you add the word update to the list of tags
What the community thinks:
Good job. I made one similar to yours, but it was 536 bytes. Yours is way smaller. (mine uses labels and gotos.) I don't have a chord, however, and cannot connect. One major flaw, though. The number is stored as variable A. If the user types in A as a guess, it will be right. Don't let the cheaters get away with it! Here's a way to prevent them from cheating.
Input "YOUR GUESS?", Str1
If Str1="A"
Then
Pause "CHEATER"
Goto 1
End
expr(Str1)->A
What it does is prompt with input, so the user doesn't know that it is a string. Then it checks if the user tried to cheat with "A". If not, it stores the value of their number from String to the actual variable A. Then you can go check if the number was too high or low. However, it does have a flaw. If the user didn't input "A" or a number, it will cause an error. One way to fix this is to check if it is "A" or if it is a number. If not, give them a warning and start over. But all that takes up precious bytes. So decide: anti cheating or more bytes?
Good job! I hope you continue programming. Try adding different difficulties, or high scores.
Wait. I'm sorry. There is another way to cheat. My previous method only checked one. If the user types in "1XA", it will work. Try this:
For(A,1,length(Str1
If sub(Str1,A,1)="B"
Then
Pause "CHEATER"
Goto 1
End
End
expr(Str1)->A
It checks every character.
What you are referring to is validation, and we actually have a page already dedicated to that. In addition, instead of looping through all of the characters looking for the letter, you can simply use the inString( command.