8-Bit Software Online Conversion
:0.M.TABLES? - Listing
10REM A MULTIPICATION TESTER
20REM BY ANDREW YORK IN 1996
30REM ----------------
1:REM
40MODE7:VDU23;10,32;0;0;0:ON ERROR IF
ERR=17 THEN RUN ELSE GOTO 2070
60*FX4,1
70*FX18
80PRINT"
Tester ";:PRINT"
";:PRINT"
";
:PRINT"
";
130PRINT"
";:PRINT"
";:PRINT" 1. A test
to pit your wits against ";:PRINT"
";
:PRINT" 2. A random test! ":PRINT"
";
190PRINT" 3. View Multipication table
";:PRINT"
";:PRINT" 4. Leave p
rogram and return to basic ";:PRINT"
";
:PRINT"
";
240PRINT"
";:PRINT"
";:PRINT"
";:PRINT"
";
:PRINT"
";
290PRINT"
";:PRINT"
";:PRINT" By A.M.Y
ork For The BBC Micro 1996 ";:REPEAT:C
HOICE$=GET$:SOUND1,20,90,1 :IF CHOICE$="
1" THEN PROCtest
350IF CHOICE$="2" THEN PROCmajortest
360IF CHOICE$="3" THEN PROCtable
370IF CHOICE$="4" THEN PROCexit
380UNTIL FALSE
390DEFPROCtest :INPUTTAB(1,18);" What
table (2-12) ?"A :VDU28,0,24,39,2:CLS:V
DU26:IF A <2 THEN A=2
412IF A >12 THEN A=12
420C=1:D=5:E=2:F=0:REM" Im not very go
od at using all
452REM" these stupid variables!
460VDU28,0,24,39,2:CLS:VDU26:PRINTTAB(
1,3);" Correct " :PRINTTAB(21,3);"
Wrong " :PRINTTAB(4,5);" 0":PRINTTA
B(25,5);"0": FOR B = 1 TO 12 :D=D+2:IF
B =7 THEN E=E+20:D=7
540ANSWER= A * B:PRINTTAB(E,D);" ";B"
X ";A" = "; :INPUT input:IFinput=ANSWER
THEN F=F+1:PRINTTAB(5,5);F:SOUND 1,90,19
,1
580IFinput <> ANSWER THEN G=G+1:PRINTT
AB(25,5);G:SOUND 1,50,90,1:PROCpractice
590NEXT B:PROCwelldone:ENDPROC
600END
610DEFPROCpractice:B=B-1:CORRECT=A*B
620VDU28,0,24,39,18:PRINTTAB(5);"
ppppppppppppppppppp" :E=0:REPEAT:PRINTT
AB(5);" EEU
NTIL E=4:PRINTTAB(5);"
ppppp¶" :PRINTTAB(7,2);" ";B;" X ";A;"
= "; :INPUT wrong:IF wrong <> CORRECT
THEN CLS:VDU7:GOTO 620
690PRINTTAB(7,4);" ";wrong;" + ";A;" =
"; :INPUT ok :IF ok <> wrong + A TH
EN CLS:PRINTTAB(5);"
pppp":E=0:REPEAT:PRINTTAB(5);"
EEUNTIL EPRINTTAB
(5);" PRINTTAB
7,2);" ";B;" X ";A;" = ";wrong::GOTO 69
0
720CLS:B=B+1:IF B >=7 THEN E=22 ELSE E
=2
740VDU26:ENDPROC
750DEFPROCwelldone:VDU28,0,24,39,18:CL
S:SOUND1,20,120,1 : IF F=12 THEN PRINT
'" Welldone you got all twelve right!":
GOTO840
790IF F = 6 THEN PRINT'" Welldone you
got half right!":GOTO840
800IF F >10 THEN PRINT'" Good try you
nearly got all them right":GOTO840
810IF F <6 THEN PRINT'" Good try but
you need some more":PRINT" practice.":G
OTO840
820IF F <4 THEN PRINT'" You need to l
earn your tables!":GOTO840
830PRINT'" Good try you got ";F;" righ
t out of twelve"
840PRINTTAB(5);" Press Space to contin
e"; :REPEAT:A$=GET$:UNTIL A$=" ":CLS:VDU
26:VDU28,0,24,39,2:CLS:RUN
870DEFPROCmajortest :REM" WHAT A MESS!
872REM" WELL AT LEAST IT WORKS
880E=2:D=5:G=0:H=0:VDU28,0,24,39,2:CLS
:VDU26:PRINTTAB(1,3);" Correct ":PRI
NTTAB(21,3);" Wrong ":PRINTTAB(4,5)
;" 0" :PRINTTAB(25,5);"0" :FOR OG = 1 T
O 18 :B=RND(12):IF B=0 THEN B=3
990A=RND(12):IF A=0 THEN A=4
1000D=D+2:IF OG =10 THEN E=23:D=7
1020PRINTTAB(E,D);" ";B" X ";A" = ";:ri
ght=B*A:INPUT input:IF input=right G=G+1
:PRINTTAB(4,5);" ";G:SOUND1,20,90,1 ELSE
H=H+1:PRINTTAB(25,5);" ";H :SOUND1,20,3
0,1
1060 NEXT OG:PRINTTAB(12,D+1);" PRESS S
PACE";:REPEAT:A$=GET$:UNTIL A$=" ":RUN :
ENDPROC
2000DEFPROCexit:*FX8
2020*FX4,0
2030:VDU28,0,24,39,2:CLS:VDU26 :PRINT
TAB(2,5);" BYE ....":VDU28,0,24,39,2:A$=
INKEY$(30):CALL !-4 :END
2060ENDPROC
2070ONERROR OFF
2080*FX4,0
2090VDU26:CLS:REPORT:PRINT" at line ";E
RL:END
2130DEFPROCtable:CLS:PRINT"
";:PRINT" 0 1 2 3 4 5 6 7
8 9 10 ";:PRINT"
";
2190PRINT" 1 1 2 3 4 5 6 7 8
9 10 ";:PRINT"
";:PRINT" 2 2 4
6 8 10 12 14 16 18 20 ";:PRINT"
";
:PRINT" 3 3 6 9 12 15 18 21 24 27 3
0 ";
2240PRINT"
";:PRINT" 4 4 8 12 16 20 2
4 28 32 36 40 ";:PRINT"
";:PRINT"
5 5 10 15 20 25 30 35 40 45 50 ";
:PRINT"
";
2290PRINT" 6 6 12 18 24 30 36 42 48 5
4 60 ";:PRINT"
";:PRINT" 7 7 14 2
1 28 35 42 49 56 63 70 ";:PRINT"
";
:PRINT" 8 8 16 24 32 40 48 56 64 72 8
0 ";
2340PRINT"
";:PRINT" 9 9 18 27 36 45 5
4 63 72 81 90 ";:PRINT"
";:PRINT" 1
0 10 20 30 40 50 60 70 80 90 100 ";
:PRINT" Press space";:REPEAT:A$=GET$:UNT
IL A$=" ":RUN:ENDPROC