8-Bit Software Online Conversion
Counter/Frequency Calculator - Listing
10DEFFNS="Counter"
20IFPAGE<>&1D00:PAGE=&1D00:CHAIN"Coun
ter"
30FORL%=&1900TO&1CF0STEP4:!L%=0:NEXT
40ONERROR:VDU3:IFERR<>17:REPORT:PRINT
ERL:END
50MODE7
60PROCscr
70REPEAT
80VDU31,13,19,129,141,32,32,32,31,13,
20,131,141,32,32,32
90T%=0:C%=0
100REPEAT
110REPEAT:A%=GET-48:UNTIL A%>-1 AND A%
<10 OR A%=35 OR A%=28 OR A%=20 OR A%=21
OR A%=79
120VDU31,15+T%,19,A%+48,31,15+T%,20,A%
+48
130T%=T%+1
140IFA%>-1 IF A%<10 PROCadd ELSE C%=-1
150UNTILT%=3 OR A%=35 OR A%=28 OR A%=2
0 OR A%=21 OR A%=79
160IFA%=35:OSCLI"SA. CData 1900 1CF0"
170IFA%=28:OSCLI"LO. CData 1900"
180IFA%=20:MODE0:PROCdisp:MODE7:PROCsc
r
190IFA%=21:END
200IF C%<>-1 ?(&1900+C%)=?(&1900+C%)+1
:IF ?(&1900+C%)=255:VDU7:PRINT'"Warning!
! Memory full at "STR$C%
210UNTILFALSE
220DEFPROCadd
230IF T%=1 C%=C%+A%*100
240IF T%=2 C%=C%+A%*10
250IF T%=3 C%=C%+A%
260ENDPROC
270DEFPROCdisp
280CLS
290PRINT''"Printer on? Y/N"
300A$=GET$
310IF A$="Y":VDU2
320IF A$="N" PRINT''" Spool to Results
? Y/N":A$=GET$:IF A$="Y":OSCLI"SPOOL Res
ults"
330B%=0:FORL%=&1900TO&1CE7:IF?L%>B% B%
=?L%:NEXT ELSE NEXT
340PRINT"Colour frequency calculator f
or 8BS by CJR."''
350Y%=0:FORL%=&1900TO&1900+1000:Y%=Y%+
?L%:NEXT:PRINTSTR$(Y%);" Numbers used"
360Y%=0:FORL%=&1900TO&1900+1000:IF ?L%
<>0 Y%=Y%+1:NEXT ELSE NEXT
370PRINTSTR$(Y%);" Colours used"'
380PRINT"Col. Frq. Col. Frq. Col. Frq.
Col. Frq. Col. Frq. Col. Frq. Col. Frq.
Col. Frq."'
390Z%=0
400FORL%=B%TO0STEP-1
410FORI%=&1900TO&1CE7
420IF?I%=L%:PRINT TAB(Z%);STRING$(3-LE
N(STR$(I%-&1900)),"0");STR$(I%-&1900);TA
B(Z%+3)"=";L%;:Z%=Z%+10:IF Z%=80 Z%=0
430NEXT
440NEXT
450VDU3
460*SPOOL
470PRINT''"Press a key.":REPEATUNTILGE
T
480ENDPROC
490DEFPROCscr
500VDU23;8202;0;0;0;
510PRINT'"
520PRINT"
530PRINT'TAB(10)" By C.J.Richardson."
540PRINT'" Keeps a tally of 1000 nu
mbers."
550PRINT'" Originally designed to work
out colour"
560PRINT" frequency for cross stitch
charts."
570PRINT'TAB(5)" Enter a 3 digit numbe
r or:"
580PRINT'TAB(7)" (S)ave."
590PRINTTAB(7)" (L)oad."
600PRINTTAB(7)" (D)isplay data."
610PRINTTAB(7)" (E)nd."
620ENDPROC