'===========================================================================
' Subject: TYPING DRILL                       Date: 04-14-96 (14:33)       
'  Author: Andrew Jones                       Code: QB, QBasic, PDS        
'  Origin: FidoNet QUIK_BAS Echo            Packet: MISC.ABC
'===========================================================================
'Typing drill.  Very elementary, not sure if the timing is absolutely
'correct.

CLS
word = 1
PRINT "Typing drill...  Type one sentence as quickly as you can..."
PRINT "It can be as short as you want or as long, but keep a constant length."
PRINT "The best drill sentence would be: 'The quick brown fox jumped over the lazy dog'"
PRINT "because it uses all alphabet keys...  Long sentences are more stastically"
PRINT "accurate."
PRINT "Timing starts at the first key pressed!"
PRINT
DO
b$ = INKEY$
LOOP UNTIL b$ <> ""
PRINT b$;
TIMER ON
ON TIMER(1) GOSUB timerr
DO
a$ = INKEY$
SELECT CASE a$
CASE CHR$(8)
corr = corr + 1
SOUND 400, .2
SOUND 500, .2
SOUND 400, .2
b$ = MID$(b$, 1, LEN(b$) - 1)
IF LEN(b$) >= 1 THEN
LOCATE CSRLIN, POS(0) - 1
PRINT " ";
LOCATE CSRLIN, POS(0) - 1
ELSE
LOCATE CSRLIN, 1
PRINT " ";
LOCATE CSRLIN, 1
END IF
CASE CHR$(32) TO CHR$(127)
SOUND 200, .2
b$ = b$ + a$
PRINT a$;
CASE ELSE
END SELECT
LOOP UNTIL a$ = CHR$(13)
FOR t = 1 TO LEN(b$)
m$ = MID$(b$, t, 1)
IF m$ = " " THEN word = word + 1
NEXT
PRINT
PRINT
PRINT "Statistics:"
IF sec = 0 THEN
PRINT "No time was passed, at least according to significant figures used!"
END
END IF
PRINT "Seconds typing: "; sec
PRINT "Words Per Second: "; word / sec
PRINT "Words Per Minute: "; (word / sec) * 60
PRINT "Corrections Made: "; corr
 
END
 
timerr:
sec = sec + 1
RETURN
