#gruppi.bas WPM = 35 FQ = 660 LINES = 8 GRPXLINE =4 LETTERS = 0 NUMBERS = 1 HSPACING = 40 VSPACING = 10 NUMRATIO = 20 choice = 1 while(choice) valid_form = 0 choice = 0 gosub inputform PAUSA = 12/WPM ' PAUSA = 6/(5*WPM) if choice = 1 then fn wait(2) morse "vvvvv",WPM,FQ,2,WPM fn wait(1) ' ? "Breakpoint A" 'sub drawgroups draw -1 groups = LINES*GRPXLINE for i = 0 to groups-1 if rnd(100) < NUMRATIO then type = NUMBERS else type = LETTERS endif if (type = LETTERS) then base = 65 offset = 25 else base = 48 offset = 9 endif curgroup$ = "" for k = 1 to 5 curgroup$ = curgroup$ & chr$(base+rnd(offset+1)) next k morse curgroup$,WPM,FQ,2,WPM draw curgroup$, HSPACING*(i mod GRPXLINE), 20+int(i/GRPXLINE)*VSPACING fn wait(PAUSA) next i fn pen(0) 'end drawgroups '? "Breakpoint Drawgroups" ' ? "Breakpoint B" endif '? "Breakpoint C" wend end sub inputform while (valid_form = 0) draw -1 s$(0) = "WPM" s$(1) = WPM s$(2) = "FREQ" s$(3) = FQ choice = form(9, 2, "Morse Tutor IK0YGJ") '? choice if choice = 1 then valid_form = 0 if val(s$(1)) <> 0 and val(s$(3))<> 0 then valid_form = 1 WPM = val(s$(1)) FQ = val(s$(3)) else ? "Please enter all values" s$(1) = "15" s$(3)= "660" endif else valid_form = 1 endif wend return