0 ''LIST 0,65000
1 GOTO 60000
10 DATA "''PROGRAM DESCRIPTION (11-89)"
95 '' SUBROUTINE LIST
96 DATA "MAIN", ""
100 '' INITIALIZE STANDARD VARIABLES (101-149)
101 DEFINT I-N: DEFSTR S
102 LTRUE = -1: LFALSE = 0
103 WIDTH "scrn:", 80: WIDTH "lpt1:", 80: IWAIT = 1000
104 DOUB$ = CHR$(14): UNDOUB$ = CHR$(20): COMP$ = CHR$(15): UNCOMP$ = CHR$(18):     CR$ = CHR$(13): EJCT$ = CHR$(12)
150 '' INITIALIZE PROGRAM VARIABLES (151-199)
200 '' MAIN PROGRAM (201-999)
205 CLS
206 DEFSNG X-Z
207 GOSUB 399
210 DIM X(20),Z(20),F(20) : INPUT "frq iz spd"; FRQ, IZ,ISPD : ICT = 2000
215 CLS: FOR I = 1 TO IZ:  F(I) = INT((I/IZ)*FRQ) + 37 : SOUND F(I),13: PRINT I TAB(78) "!": NEXT I
218 SOUND 37,20
220 FOR I = 1 TO ICT
230  Y = RND
231  Y = INT(Y*IZ)+1
233 F = INT((Y/IZ)*FRQ)+37
250  X(Y) = X(Y) + 1
255 IF X(Y) < 70 THEN SOUND F(Y),ISPD: LOCATE Y, X(Y)+9: PRINT CHR$(26) Y   ; ELSE IF X(Y) = 70 THEN  CT = CT + 1: LOCATE Y,4: PRINT CT: IF CT = IZ THEN I = ICT
260 NEXT I
270 FOR I = 1 TO IZ
280  Z(I) = X(I) / ICT
290  IF XMAX < Z(I) THEN XMAX = Z(I)
300 NEXT I
305 XFACT = 50 / XMAX
306 FOR I = 1 TO 1000: NEXT I :LOCATE IZ+1,1
310 FOR I = 1 TO IZ
320  Y = INT(Z(I) * XFACT)
330  PRINT I X(I)  Z(I) TAB(30) STRING$(Y, 34)
340 NEXT I
350 END
399 X$ = TIME$
400 XT$ = MID$(X$,4,2) + MID$(X$,7,2)
401 XRD = VAL(XT$)
402 RANDOMIZE (XRD) : PRINT XRD
403 RETURN
10000 '' STANDARD SUBROUTINES  (10000-19999)
20000 '' STANDARD FILE DEFINITIONS AND I/O ROUTINES (20000-29999)
60000 '' PROGRAM INITIALIZATION (INIT PROGRAM)
60010 CLS
60020 PRINT "STANDARD PROGRAM INITIALIZATION"
60025 TMP$ = DATE$
60030 IF TMP$  = "00-00-1980" THEN INPUT "day"; X$: DATE$ = "4-" + X$ + "-82"
60040 PRINT DATE$
60050 PRINT: PRINT "Following files on disk:": PRINT
60060 FILES "R???????.*"
60070 PRINT
60080 ''   load subroutines
60090 RESTORE 96
60100 READ X$
60110 IF X$ = "SKELETON" THEN INPUT "Enter main program name: ", X$: IF X$ = "NEW" OR X$ = "new" THEN GOTO 60175 ELSE CHAIN MERGE  X$, 60090!, ALL
60120 IF X$ <> "MAIN" AND X$ <> "main"                                                      THEN PRINT "invalid subroutine list in 76": BEEP: STOP
60125 ITMP = 2
60130 PRINT X$ " loaded"
60140 RESTORE 96: FOR I = 1 TO ITMP: READ X$: NEXT I
60150 IF X$ = "" THEN GOTO 60180
60155 ITMP = ITMP + 1
60160 CHAIN MERGE X$, 60130!, ALL
60170 STOP
60175 PRINT "SKELETON program loaded; ready for entry of new program"
60176 TMPSW = 1
60180 ''  setup function keys
60190 KEY 10, CHR$(27) + "cls" + CHR$(13)
60200 KEY 9, "goto 60300" + CHR$(13)     '...LIST helper
60210 KEY 4, "goto 60360" + CHR$(13)     '...SAVE" helper
60220 KEY 2, "run 100" + CHR$(13)
60230 PRINT "function keys defined as:"
60240 PRINT "  F2    run 100"
60250 PRINT "  F4    SAVE helper"
60260 PRINT "  F9    LIST helper"
60270 PRINT "  F10   cls"
60275 IF TMPSW = 1 THEN PRINT "   change subroutine list in statement 96": PRINT "96 DATA " + CHR$(34) + "MAIN" + CHR$(34) + ", " + CHR$(34) + CHR$(34):              LOCATE CSRLIN-2, 1
60280 END
60290 ''   LIST helper
60300 CLS
60310 INPUT TEMPX
60320 IF TEMPX <> 0 THEN TMP$ = "list " + STR$(TEMPX-80) + "-" + STR$(TEMPX+80)
60330 PRINT TMP$
60340 LOCATE 1,1
60350 END
60360 ''   SAVE helper
60370 CLS
60380 PRINT "SAVE function"
60390 INPUT "save file name "; Y$
60400 INPUT "delete subroutines (Y/N)"; X$
60410 LOCATE 5,1
60420 IF X$ = "Y" OR X$ = "y" THEN PRINT "DELETE 10001-19999": PRINT
60430 PRINT "SAVE " + CHR$(34) + Y$ + CHR$(34) + ",a
60440 PRINT
60450 IF X$ = "Y" OR X$ = "y" THEN PRINT "press enter twice to execute"   ELSE PRINT "'press enter to execute"
60460 LOCATE 4,1
60470 END
"Y" OR X$ = "y" THEN PRINT "press e