TGC Codebase Backup



Reaction Timer by Sagax

23rd Sep 2007 15:43
Summary

A program that calculates reaction time in seconds



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    1:
cls:ink rgb(244,214,210),0:set cursor 230,0:print "Reaction Time":print:print "Keep your hand on the return key!"
print "When the word "now" appears, press the return key to stop the timer.":print:input "Press return to start";A$:CLS
ink rgb(255,0,0),1:left=(275):top=(250):ellipsewidth=(200):ellipseheight=(200):ellipse left,top,ellipsewidth,ellipseheight
ink rgb(255,255,255),1:print "On your mark...":sleep rnd(3000):print "Get set....":sleep rnd(3000):ink rgb(0,255,0),1:print "NOW!"
ink rgb(0,255,0),1:ellipsewidth=(200):ellipseheight=(200):ellipse left,top,ellipsewidth,ellipseheight:a=timer():suspend for key
b=timer():c=b-a:print c/1000.000;"seconds":ink rgb(255,255,255),1:print "TRY AGAIN?":suspend for key:goto 1