8-Bit Software Online Conversion
Typing Tutor - Listing
10REM "
30ONERROR GOTO540
40MODE3:VDU23;8202;0;0;0;:PROCinit:PR
OCheader:REPEAT:A=FNlesson
50LESS$="LESSN"+STR$A:L%=OPENIN(LESS$
):PROCteach:PROCsentences:CLOSE#L%:CLS:U
NTIL0
60DEFPROCheader:PROCbox(0,20,79,4):PR
INTTAB(0,0);CHR$11:RESTORE70:FORI=1TO12:
VDU23,224:FORJ=1TO8:READK:VDUK:NEXT:SOUN
D0,-8,2,1:PRINTTAB(33+I,0);CHR$224:PROCd
el(RND(50)):NEXT:PRINTTAB(2,22);"Words/M
inute:"TAB(40,22);"Accuracy:":PROCw:ENDP
ROC
70DATA&FE,&10,&10,&10,&10,&10,&10,0,&
82,&82,&82,&FE,&10,&10,&10,0,&FE,&82,&82
,&FE,&80,&80,&80,0,&FE,&10,&10,&10,&10,&
10,&FE,0,&F2,&92,&92,&92,&92,&92,&9E,0,&
FE,&80,&80,&8E,&82,&82,&FE,0,0,0,0,0,0,0
,0,0,&FE,&10,&10,&10,&10,&10,&10,0,&82,&
82
80DATA&82,&82,&82,&82,&FE,0,&FE,&10,&
10,&10,&10,&10,&10,0,&FE,&82,&82,&82,&82
,&82,&FE,0,&FE,&82,&82,&FE,&88,&88,&8E,0
90DEFPROCdel(del):T=TIME+del:REPEATUN
TILTIME>T:ENDPROC
100DEFPROCinit:VDU23,224,&54,&2A,&54,&
2A,&54,&2A,&54,&2A,23,225,0,&18,&3C,&7E,
&18,&18,&18,0,23,226,0,&18,&18,&18,&7E,&
3C,&18,0:*FX11,0
110wpm%=0:acc%=0:SC%=0:DIMST$(2),MS$(2
):ENDPROC
120DEFPROCbox(TL,TR,WD,DP):PRINTTAB(TL
,TR);STRING$(WD,CHR$224):PRINTTAB(TL,TR)
;STRING$(DP-1,CHR$224+CHR$8+CHR$10):PRIN
TTAB(TL,TR+DP-1);STRING$(WD,CHR$224):PRI
NTTAB(TL+WD-1,TR);STRING$(DP-1,CHR$224+C
HR$8+CHR$10):ENDPROC
130DEFFNlesson:PROCcentre(8,"Choose a
lesson:"):LESS$="Lesson ":LESS%=1:PROCre
do:REPEAT:IFINKEY-58ANDLESS%<22 LESS%=LE
SS%+1:PROCredo
140IFINKEY-42ANDLESS%>1 LESS%=LESS%-1:
PROCredo
150UNTILINKEY-74:=LESS%
160DEFPROCcentre(TL,CN$):IFLENCN$/2<>L
ENCN$ CN$=CN$+" "
170CS$=STRING$((80-LENCN$)/2," "):CN$=
CS$+CN$+CS$:PRINTTAB(0,TL);CN$;TAB(0,0):
ENDPROC
180DEFPROCredo:PROCcentre(9,LESS$+STR$
LESS%):RESTORE190:FORK=1TOLESS%:READK$:N
EXT:PROCcentre(10,"="+K$+"="):ENDPROC
190DATAThe Home Keys,The keys E and H,
The keys G and U,The keys R and I,The ke
ys T and O,Some Practice,The keys W and
N,The shift keys,Punctuation,The keys B
and M,The keys Y and C,General Practice,
The keys P and V,The keys Q and X
200DATAThe keys Z and /,General Practi
ce II,Some more practice,Right hand Prac
tice,Left hand practice,Numerals,Other S
ymbols,Practice
210DEFPROCw:VDU28,0,20,79,2:ENDPROC
220DEFPROCform(ea$,a):a=a-(a=0):PRINTT
AB(0,a-1):REPEAT
230IFLEFT$(ea$,1)=" "ea$=RIGHT$(ea$,LE
Nea$-1):GOTO230
240IFLEN(ea$)<=79PRINTea$;:UNTIL1:GOTO
290
250fa$=LEFT$(ea$,79):ga=0:FORha=LENfa$
TO1STEP-1:IFMID$(fa$,ha,1)=" "ANDga=0ga=
ha
260NEXT:IFga=0ga=79
270fa$=LEFT$(fa$,ga):ea$=RIGHT$(ea$,LE
Nea$-LENfa$):PRINTfa$:IFVPOS>15PROCspc
280UNTIL0
290IFVPOS>15 PROCspc
300ENDPROC
310DEFPROCspc:PROCcentre(17,"Press Spa
ce Bar"):REPEATUNTILINKEY-99:CLS:PRINT:E
NDPROC
320DEFPROCteach:PROCstats:CLS:REPEAT:I
NPUT#L%,TC$:IFTC$="###"GOTO340
330PROCform(TC$,VPOS+1):UNTIL0
340UNTIL1:PROCspc:ENDPROC
350DEFPROCsentences:INPUT#L%,NS%:FORSR
TT=1TONS%:INPUT#L%,ST$:PROCdispsent:PROC
typesent:SC%=SC%+1:PROCustat:PROCstats:N
EXT:ENDPROC
360DEFPROCstats:VDU26:PRINTTAB(2,23);S
PC(70)TAB(2,23);"Lesson: ";K$TAB(16,22);
LEFT$(STR$wpm%,4);SPC4TAB(50,22);LEFT$(S
TR$acc%,4);"% ":PROCw:ENDPROC
370DEFPROCustat:acc%=((SC%-1)*acc%+cac
c%)/SC%:wpm%=((SC%-1)*wpm%+cwpm%)/SC%:EN
DPROC
380DEFPROCdispsent:PROCcentre(1,"Pleas
e type:")
390IFLENST$<79ST$(1)=ST$:ST$(2)="":GOT
O410 ELSE LST$=LEFT$(ST$,79):FSP=-1:FORP
IS=79 TO 1 STEP-1:IFMID$(LST$,PIS,1)=" "
AND FSP=-1 FSP=PIS
400NEXT:ST$(1)=LEFT$(ST$,FSP):ST$(2)=R
IGHT$(ST$,LENST$-FSP)
410MS$(1)=STRING$(LENST$(1)," "):MS$(2
)=STRING$(LENST$(2)," "):PRINTTAB(0,3);S
T$(1)TAB(0,6);ST$(2):ENDPROC
420DEFPROCtypesent:nw%=1:FORPIS=1TOLEN
ST$:IFMID$(ST$,PIS,1)=" " nw%=nw%+1
430NEXT:tut%=1:PROCtype(ST$(1),3,11,1)
:PROCtype(ST$(2),6,12,2):t=TIME/6000:cwp
m%=nw%/t:mst=0:FORPIS=1TOLENMS$(1):IFMID
$(MS$(1),PIS,1)=CHR$225mst=mst+1
440NEXT:FORPIS=1TOLENMS$(2):IFMID$(MS$
(2),PIS,1)=CHR$225mst=mst+1
450NEXT:cacc%=100-(mst/LENST$)*100
460CLS
470ENDPROC
480DEFPROCtype(STT$,SPS%,TPP%,STN):IFL
ENSTT$=0ENDPROC ELSE *FX21
490pis%=1:REPEAT:PRINTTAB(pis%-1,SPS%-
1);CHR$226:G$=GET$:PROCstime:IFG$=MID$(S
TT$,pis%,1) PRINTTAB(pis%-1,SPS%-1);" "T
AB(pis%-1,TPP%);G$:pis%=pis%+1:GOTO510
500SOUND1,-10,100,1:MS$(STN)=LEFT$(MS$
(STN),pis%-1)+CHR$225+RIGHT$(MS$(STN),LE
NMS$(STN)-pis%):PRINTTAB(0,SPS%+1);MS$(S
TN):UNTIL0
510IFpis%>LENSTT$ UNTIL1:ENDPROC ELSEU
NTIL0
520DEFPROCstime:IFpis%=1 AND STN=1 AND
LEFT$(MS$(1),1)=" " THEN TIME=0
530ENDPROC
540MODE7:PRINT" Error at line ";ERL';"
";:REPORT:CLOSE#0