06-24-2024, 09:18 AM
Hello everyone,
I'm new on this Forum and also 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 command should I use to make it pause until the user presses a key?
Thanks for your help !
I'm new on this Forum and also 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 command should I use to make it pause until the user presses a key?
Thanks for your help !