The Dink Network

Reply to Re: reaction time DMOD

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 14th 2005, 10:03 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Then I wonder how you are wanting to measure reaction time. But to answer your question why it fails.

early.c:

void main( void )
{
&early = -2;
wait(5000);
&early = 0;
timerloop:
//Replace this by whatever method you use to measure reaction time. I re-use &early in this case.
wait(5);
&early += 5;
goto timerloop;
}

void kill( void )
{
kill_this_task();
}

//*script before
int &timer = spawn("early");
loop:
wait(1);
wait_for_button();
if (&early == -2)
{
say("you're too early",1);
goto loop;
}
say("your reaction time: &early",1);
run_script_by_number(&timer, "kill");
//*script after

In this case, I've put only the timing in early.c. The main script still handles being too early. I don't what could go wrong initially. Perhaps you should add { and } to if-statemens. I know they shouldn't matter with just one line following, but then, they just might.