I live in France and I’m new to programming.
I’m trying to code a test to assess the ability to concentrate (https://smallbasic.com/program/?RKCP997.000) but I’m encountering a problem.
This is how it should work:
A letter appears on the screen for 0.5 seconds then it disappears.
You have to memorize it.
Then 4 random letters appear and you must press as quickly as possible on the “Left” key if the original letter is absent and on the “Right” key if it is present.
So far my code works.
But this test should be repeated for 2 minutes, and at the end the number of errors and the average reaction time should be displayed.
But when I make a loop (lines 13 and 38 in my program), the program loops without waiting for the user to press LEFT or RIGHT.
What function should I use to make the program wait/pause until the user presses a key?
Thanks for your help ! 🙂
Prosper GROUX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.