Morse Tutor   (Model A)


This has to be the definitive Morse code tutor. It's got everything you could possibly require to painlessly acquaint yourself with the code, and then to go on and practice until you reach professional speeds. The program offers you a comprehensive menu with a full listing of letters and numbers (in both text and Morse), a facility to convert your own messages into the code and a challenging tester section. You also have the opportunity to adjust the speed of the code to suit your own abilities. What more could you ask for?

    1 REM *** BBC VERSION ***
    2 REM *** MORSE TUTOR ***
   10 REM Morse tutor @ Robert Erskine 1983
   20 REM Converted to 16k BBC Micro by C.R.T
anner
   30 ON ERROR GOTO 70
   40 MODE 7:VDU 23;8202;0;0;0;
   50 DIM c(36,5),c$(36)
   60 GOSUB 1060
   70 CLS:PRINT TAB(0,0);CHR$(141);CHR$(129);
"------------- OPTIONS --------------"'CHR$(1
41);CHR$(131);"------------- OPTIONS --------
------"
   80 PRINT ''" Please choose one of the 6 op
tions."
   90 PRINT ''CHR$(133);"     1.....Print a m
essage"
  100 PRINT 'CHR$(133);"     2.....Message wi
th sound only"
  110 PRINT 'CHR$(133);"     3.....Create you
r own message"
  120 PRINT 'CHR$(133);"     4.....Test secti
on"
  130 PRINT 'CHR$(133);"     5.....Change spe
ed"
  140 PRINT 'CHR$(133);"     6.....The Morse 
Code"
  150 PRINT 'CHR$(133);"     7.....Leave the 
program"
  160 PRINT '''" Which option do you require?
"
  170 A=INKEY(1000):A=A-48:IF A<1 OR A>7 THEN
 170 ELSE ON A GOTO 310,300,320,430,890,950,1
230
  180 x$=v$:v$=q$+v$+h$
  190 FOR x=1 TO LEN(v$)-38
  200   IF O=0 THEN PRINT TAB(0,12);CHR$(141)
;MID$(v$,x,37)'CHR$(141);MID$(v$,x,37)
  210   T=ASC(MID$(v$,x+36,1))
  220   FOR y=1 TO 5
  230     TIME=0
  240     IF T>64 THEN IF c(T-64,y)<>0 THEN T
IME=-((c(T-64,y)*5)+2):SOUND 1,-15,100,c(T-64
,y):REPEAT UNTIL TIME>0
  250     IF T<58 AND T>47 THEN IF c(T-21,y)<
>0 THEN TIME=-((c(T-21,y)*5)+2):SOUND 1,-15,1
00,c(T-21,y):REPEAT UNTIL TIME>0
  260   NEXT y
  270   TIME=0:REPEAT UNTIL TIME>20
  280 NEXT x
  290 GOTO 400
  300 O=1:v$=f$:GOTO 180
  310 CLS:v$=f$:O=0:GOTO 180
  320 CLS:PRINT TAB(0,0);CHR$(141);CHR$(129);
"--------- CREATE A MESSAGE ---------"'CHR$(1
41);CHR$(131);"--------- CREATE A MESSAGE ---
------"
  330 PRINT '" Enter your own message at the 
bottom ofthe screen and then press the <RETUR
N>  key."''''''''
  340 INPUT v$:IF LEN(v$)>200 THEN PRINT TAB(
6,24);CHR$(136);"THIS IS TO LONG";:TIME=0:REP
EAT UNTIL TIME>300:GOTO 320
  350 CLS:PRINT TAB(0,8);" Do you want the me
ssage displayed in   both sound and vision? (
Y or N)"
  360 TIME=0:REPEAT UNTIL TIME>200
  370 IF INKEY(-86) THEN O=1:CLS:GOTO 180
  380 IF INKEY(-69) THEN O=0:CLS:GOTO 180
  390 GOTO 370
  400 O=0
  410 f$=x$
  420 GOTO 70
  430 CLS:PRINT TAB(0,0);CHR$(141);CHR$(129);
"---------- TEST  SECTION ----------"'CHR$(14
1);CHR$(131);"---------- TEST  SECTION ------
----"'
  440 PRINT " Do you want to be tested on cha
racters (1) code (2) or sound (3)?";
  450 A=INKEY(1000):A=A-48:IF A<1 OR A>3 THEN
 GOTO 450 ELSE W=A
  460 PRINT TAB(0,3);" Do you want testing on
 letters (1) or  numbers (2)?               "
;
  470 A=INKEY(1000):A=A-48:IF A<1 OR A>2 THEN
 GOTO 470 ELSE B=A
  480 IF W>1 THEN GOTO 610
  490 TIME=0:REPEAT UNTIL TIME>100
  500 PRINT TAB(0,3);"The character will appe
ar first followedshortly by the code and soun
d."'':TIME=0:REPEAT UNTIL TIME>200
  510 FOR x=1 TO 15
  520   IF B=1 THEN v=INT(RND(25)+1):PRINT TA
B(15);CHR$(v+64);
  530   IF B=2 THEN v=INT(RND(9)+27):PRINT TA
B(15);CHR$(v+21);
  540   TIME=0:REPEAT UNTIL TIME>100
  550   FOR y=1 TO 5
  560     IF c(v,y)<>0 THEN TIME=-((c(v,y)*5)
+2):SOUND 1,-15,100,c(v,y):REPEAT UNTIL TIME>
0
  570   NEXT y
  580   PRINT " = ";c$(v)
  590 NEXT x
  600 TIME=0:REPEAT UNTIL TIME>800:GOTO 70
  610 IF W>2 THEN GOTO 750
  620 PRINT TAB(0,3);"The code will appear fi
rst ,  followed  shortly by the character and
 sound."'':TIME=0:REPEAT UNTIL TIME>200
  630 FOR x=1 TO 15
  640   IF B=1 THEN v=INT(RND(25)+1)
  650   IF B=2 THEN v=INT(RND(9)+27)
  660   PRINT TAB(17-LEN(c$(v)));c$(v);:TIME=
0:REPEAT UNTIL TIME>100
  670   FOR y=1 TO 5
  680     IF c(v,y)<>0 THEN TIME=-((c(v,y)*5)
+2):SOUND 1,-15,100,c(v,y):REPEAT UNTIL TIME>
0
  690   NEXT y
  700   PRINT " = ";
  710   IF B=1 THEN PRINT CHR$(v+64)
  720   IF B=2 THEN PRINT CHR$(v+21)
  730 NEXT x
  740 TIME=0:REPEAT UNTIL TIME>800:GOTO 70
  750 PRINT TAB(0,3);" The sound will appear 
first , followed shortly by the character and
 code."'':TIME=0:REPEAT UNTIL TIME>200
  760 FOR x=1 TO 15
  770   IF B=1 THEN v=INT(RND(25)+1)
  780   IF B=2 THEN v=INT(RND(9)+27)
  790   FOR y=1 TO 5
  800     IF c(v,y)<>0 THEN TIME=-((c(v,y)*5)
+2):SOUND 1,-15,100,c(v,y):REPEAT UNTIL TIME>
0
  810   NEXT y
  820   TIME=0:REPEAT UNTIL TIME>100
  830   PRINT TAB(10);"That was ";
  840   IF B=1 THEN PRINT CHR$(v+64);" = ";c$
(v)
  850   IF B=2 THEN PRINT CHR$(v+21);" = ";c$
(v)
  860   TIME=0:REPEAT UNTIL TIME>100
  870 NEXT x
  880 TIME=0:REPEAT UNTIL TIME>800:GOTO 70
  890 CLS:PRINT TAB(0,0);CHR$(141);CHR$(129);
"------ ALTER SPEED OF CODE ------"'CHR$(141)
;CHR$(131);"------ ALTER SPEED OF CODE ------
"'
  900 PRINT " Enter a multiplication factor t
o alter the speed of the morse. Values less t
hanone will increase the speed."
  910 INPUT A
  920 IF A>9 THEN GOTO 910
  930 PRINT "Please wait":s=s*A:l=l*A:GOSUB 1
100
  940 GOTO 70
  950 CLS:PRINT TAB(0,0);CHR$(141);CHR$(129);
"---------- THE MORSE CODE ----------"'CHR$(1
41);CHR$(131);"---------- THE MORSE CODE ----
------"'
  960 FOR x=1 TO 13
  970   PRINT TAB(5);CHR$(x+64);" = ";c$(x);T
AB(25);CHR$(x+77);" = ";C$(x+13)
  980 NEXT x:PRINT
  990 FOR x=1 TO 5
 1000   PRINT TAB(5);CHR$(x+47);" = ";c$(x+26
);TAB(25);CHR$(x+52);" = ";c$(x+31)
 1010 NEXT x
 1020 PRINT TAB(6,24);CHR$(136);"PRESS ANY KE
Y TO RETURN";
 1030 *FX 15,1
 1040 IF INKEY$(1000)="" THEN GOTO 1040
 1050 GOTO 70
 1060 s=1:l=3:O=0:x$=""
 1070 f$="THIS IS A MESSAGE TO DEMONSTRATE TH
E MORSE CODE TUTOR   THE COMPLETE ALPHABET IS
 AS FOLLOWS     ABCDEFGHIJKLMNOPQRSTUVWXYZ   
AND THE NUMBERS ARE     1234567890"
 1080 q$="                                   
     "
 1090 h$=" "
 1100 RESTORE
 1110 FOR x=1 TO 36
 1120   FOR y=1 TO 5
 1130     READ c(x,y)
 1140   NEXT y
 1150 NEXT x
 1160 FOR x=1 TO 36
 1170   READ c$(x)
 1180 NEXT x
 1190 RETURN
 1200 DATA s,l,0,0,0,l,s,s,s,0,l,s,l,s,0,l,s,
s,0,0,s,0,0,0,0,s,s,l,s,0,l,l,s,0,0,s,s,s,s,0
,s,s,0,0,0,s,l,l,l,0,l,s,l,0,0,s,l,s,s,0,l,l,
0,0,0,l,s,0,0,0,l,l,l,0,0,s,l,l,s,0,l,l,s,l,0
,s,l,s,0,0,s,s,s,0,0,l,0,0,0,0,s,s,l,0,0,s,s,
s,l,0,s,l,l,0,0,l,s
 1210 DATA s,l,0,l,s,l,l,0,l,l,s,s,0,l,l,l,l,
l,s,l,l,l,l,s,s,l,l,l,s,s,s,l,l,s,s,s,s,l,s,s
,s,s,s,l,s,s,s,s,l,l,s,s,s,l,l,l,s,s,l,l,l,l,
s
 1220 DATA .-,-...,-.-.,-..,.,..-,--,....,..,
.---,-.-,.-..,--,-.,---,.--.,--.-,.-.,...,-,.
.-,...-,.--,-..-,-.--,--..,-----,.----,..---,
...--,....-,.....,-....,--...,---..,----.
 1230 MODE 7
 1240 PRINT TAB(12,12);CHR$(141);CHR$(129);"G
OOD BYE"'TAB(12);CHR$(141);CHR$(129);"GOOD BY
E"
 1250 END