Not sure what you are after. maybe something like this?
set display mode 640,480,16
set text size 160
`Data sequence
rem 1 2 3 4 5 6 7 8 9 10
data "X","Q","W","E","R","T","C","U","X","X"
data "Z","I","O","P","P","A","F","S","D","X"
data "Y","X","X"
for n = 1 to 23
if escapekey()=1 then end
X=0
inc x,1
if x=10
value=1
endif
`Letter on screen(miliseconds)
Escreen=500
`Screen without the letter(Fixed time, miliseconds)
Nscreen=1650
`Variable time(random time, miliseconds)
randomize timer()
Sscreen=rnd(249)
starttime# = timer()+Sscreen+Nscreen
while checktime# < starttime#
checktime# = timer()
if returnkey() = 1
set cursor 5,5 : print "Incorrect!"
wait 500
endif
endwhile
read Actual$
center text 320,150,Actual$
starttime# = timer()+Escreen
while checktime# < starttime#
checktime# = timer()
if returnkey() = 1
if Actual$ = "X"
set cursor 5,5 : print "Good!"
wait 500
else
set cursor 5,5 : print "Incorrect!"
wait 500
endif
endif
endwhile
cls
next n
end
[edit] This may be better.
set display mode 640,480,16
set text size 160
`Data sequence
rem 1 2 3 4 5 6 7 8 9 10
data "X","Q","W","E","R","T","C","U","X","X"
data "Z","I","O","P","P","A","F","S","D","X"
data "Y","X","X"
for n = 1 to 23
if escapekey()=1 then end
X=0
inc x,1
if x=10
value=1
endif
`Letter on screen(miliseconds)
Escreen=500
`Screen without the letter(Fixed time, miliseconds)
Nscreen=1650
`Variable time(random time, miliseconds)
randomize timer()
Sscreen=rnd(249)
`use the timer instead of the waits
`just set a variable to the value of
`timer() + the wait time you want
`then loop an input check until the
`timer is greater then or equal to
`the variable
starttime# = timer()+Sscreen+Nscreen
while timer() < starttime#
if returnkey() = 1
set cursor 5,5 : print "Incorrect!"
wait 500
endif
endwhile
read Actual$
center text 320,150,Actual$
`use the timer instead of the waits
`just set a variable to the value of
`timer() + the wait time you want
`then loop an input check until the
`timer is greater then or equal to
`the variable
starttime# = timer()+Escreen
while timer() < starttime#
if returnkey() = 1
if Actual$ = "X"
set cursor 5,5 : print "Good!"
response = 1
wait 500
else
set cursor 5,5 : print "Incorrect!"
wait 500
response = 0
endif
else
response = 0
endif
endwhile
`if X wasn't displayed give no error
if Actual$ <> "X"
response = 1
endif
cls
`if x was displayed and return was not pressed
`give error
if response = 0
set cursor 5,5 : print "Missed!"
wait 500
cls
endif
next n
end
Why not use random letters instead of pre picked ones so they cannot memorize them?
set display mode 640,480,16
set text size 160
`Data sequence
rem 1 2 3 4 5 6 7 8 9 10
data "X","Q","W","E","R","T","C","U","X","X"
data "Z","I","O","P","P","A","F","S","D","X"
data "Y","X","X"
dim Actual$(23)
randomize timer()
`assign predetermined values to Actual$() array indexs
for i = 1 to 23
read Actual$(i)
next i
testlength = 1
do
if escapekey()=1 then end
X=0
inc x,1
if x=10
value=1
endif
`Letter on screen(miliseconds)
Escreen=500
`Screen without the letter(Fixed time, miliseconds)
Nscreen=1650
`Variable time(random time, miliseconds)
randomize timer()
Sscreen=rnd(249)
`use the timer instead of the waits
`just set a variable to the value of
`timer() + the wait time you want
`then loop an input check until the
`timer is greater then or equal to
`the variable
starttime# = timer()+Sscreen+Nscreen
while timer() < starttime#
if returnkey() = 1
set cursor 5,5 : print "Incorrect!"
wait 500
endif
endwhile
`choose a random index from Actual$() to display
Pick = (rnd(22)+1)
center text 320,150,Actual$(Pick)
`use the timer instead of the waits
`just set a variable to the value of
`timer() + the wait time you want
`then loop an input check until the
`timer is greater then or equal to
`the variable
starttime# = timer()+Escreen
while timer() < starttime#
if returnkey() = 1
if Actual$(Pick) = "X"
set cursor 5,5 : print "Good!"
response = 1
wait 500
else
set cursor 5,5 : print "Incorrect!"
wait 500
response = 0
endif
else
response = 0
endif
endwhile
`if X wasn't displayed give no error
if Actual$(Pick) <> "X"
response = 1
endif
cls
`if x was displayed and return was not pressed
`give error
if response = 0
set cursor 5,5 : print "Missed!"
wait 500
cls
endif
`set test limit to 23 turns then exit
inc testlength,1
if testlength = 23
cls
set cursor 5,5
print "Test Ended"
wait 1000
exit
endif
loop
end