r/TIBASICPrograms • • May 01 '24

How to Make Timed Inputs on a TI-83+

I am trying to figure out how to make an Input command where the user has to provide an input in a certain amount of time. I need to do this in order to make a timed times tables practice game

Since on the TI-83+ you cannot delay using the Pause or Wait commands, I use this program to delay for T amount of seconds:

PROGRAM:DELAY
:0->I
:T*65->T
:While T>=I
:I+1->I
:End

To delay for 3 seconds in a program between displaying 0 and 1, I write this:

PROGRAM:TIME
:3->T
:Disp 0
:prgmDELAY
:Disp 1

The problem is that I cannot combine the prgmDELAY with an Input to limit the time that the user has to provide an input. Any help will be much appreciated.

2 Upvotes

1 comment sorted by

1

u/Idotrytotry May 02 '24

Depending on how you want it to work, it could be really easy or a little more complex.

If you have single-key inputs, such as multiple-choice, this kind of thing will work.

0 -> K
For(I,1,100
getkey
If Ans
Then
Ans -> K
100 -> I
End
End

If K = [right answer]
Then
Disp "correct
Else
Disp "you suck
End

Since Input and Prompt pause execution and the 83+ doesn't have an internal timer, if you want the user to type out an answer, I think you'll have to handle key inputs yourself and display them with Output. I might do it something like this. It's incomplete and untested, but hopefully you see the idea.

0 -> K
0 -> J
For(I,1,100
getkey
If Ans
Then
Ans -> K
If K = [enter]
100 -> I
[Read key code and convert to number]
Output(0,J,[number]
J + 1 -> J
End
End