8-Bit Software Online Conversion
Tables Tester - Listing
10REM A MULTIPICATION TESTER
20REM BY ANDREW YORK IN 1996
30REM ----------------------
40MODE7:VDU23;10,32;0;0;0
50ON ERROR IF ERR=17 THEN RUN ELSE GO
TO 2070
60*FX4,1
70*FX18
80PRINT"
90PRINT"
100PRINT"
";
110PRINT"
";
120PRINT"
";
130PRINT"
";
140PRINT"
";
150PRINT" 1. A test to pit your wits a
gainst ";
160PRINT"
";
170PRINT" 2. A random test! "
180PRINT"
";
190PRINT" 3. View Multipication table
";
200PRINT"
";
210PRINT" 4. Leave program and return
to basic ";
220PRINT"
";
230PRINT"
";
240PRINT"
";
250PRINT"
";
260PRINT"
";
270PRINT"
";
280PRINT"
";
290PRINT"
";
300PRINT"
";
310PRINT" By A.M.York For The BBC Mi
cro 1996 ";
320REPEAT
330CHOICE$=GET$:SOUND1,20,90,1
340IF CHOICE$="1" THEN PROCtest
350IF CHOICE$="2" THEN PROCmajortest
360IF CHOICE$="3" THEN PROCtable
370IF CHOICE$="4" THEN PROCexit
380UNTIL FALSE
390DEFPROCtest
400INPUTTAB(1,18);" What table (2-12)
?"A
410VDU28,0,24,39,2:CLS:VDU26
411IF A <2 THEN A=2
412IF A >12 THEN A=12
420C=1
430D=5
440E=2
450F=0
451REM" Im not very good at using all
452REM" these stupid variables!
460VDU28,0,24,39,2:CLS:VDU26
470PRINTTAB(1,3);" Correct "
480PRINTTAB(21,3);" Wrong "
490PRINTTAB(4,5);" 0"
500PRINTTAB(25,5);"0"
510 FOR B = 1 TO 12
520D=D+2
530IF B =7 THEN E=E+20:D=7
540ANSWER= A * B
550PRINTTAB(E,D);" ";B" X ";A" = ";
560INPUT input
570IFinput=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
630PRINTTAB(5);"
pp"
640E=0:REPEAT:PRINTTAB(5);"
EEUNTIL E
650PRINTTAB(5);"
p¶"
660PRINTTAB(7,2);" ";B;" X ";A;" = ";
670INPUT wrong
680IF wrong <> CORRECT THEN CLS:VDU7
:GOTO 620
690PRINTTAB(7,4);" ";wrong;" + ";A;" =
";
700INPUT ok
710IF ok <> wrong + A THEN CLS:PRINTTA
B(5);" EREPE
AT:PRINTTAB(5);"
":E=E+1:UNTIL E=4:PRINTTAB(5);"
pppppppppppppp¶":PRINTTAB(7,2);" ";B;" X
";A;" = ";wrong::GOTO 690
720CLS:B=B+1
730IF B >=7 THEN E=22 ELSE E=2
740VDU26:ENDPROC
750DEFPROCwelldone
760VDU28,0,24,39,18:CLS
770SOUND1,20,120,1
780 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";
850REPEAT:A$=GET$:UNTIL A$=" "
860CLS:VDU26:VDU28,0,24,39,2:CLS:RUN
870DEFPROCmajortest
871REM" WHAT A MESS!
872REM" WELL AT LEAST IT WORKS
880E=2
890D=5
900G=0
910H=0
920VDU28,0,24,39,2:CLS:VDU26
930PRINTTAB(1,3);" Correct "
940PRINTTAB(21,3);" Wrong "
950PRINTTAB(4,5);" 0"
960PRINTTAB(25,5);"0"
970FOR OG = 1 TO 18
980B=RND(12):IF B=0 THEN B=3
990A=RND(12):IF A=0 THEN A=4
1000D=D+2
1010IF OG =10 THEN E=23:D=7
1020PRINTTAB(E,D);" ";B" X ";A" = ";
1030right=B*A
1040INPUT input
1050IF input=right G=G+1:PRINTTAB(4,5);
" ";G:SOUND1,20,90,1 ELSE H=H+1:PRINTTAB
(25,5);" ";H :SOUND1,20,30,1
1060 NEXT OG
1070PRINTTAB(12,D+1);" PRESS SPACE";
1080REPEAT:A$=GET$:UNTIL A$=" ":RUN
1090ENDPROC
2000DEFPROCexit
2010*FX8
2020*FX4,0
2030:VDU28,0,24,39,2:CLS:VDU26
2040PRINTTAB(2,5);" BYE ....":VDU28,0,2
4,39,2:VDU14
2050END
2060ENDPROC
2070ONERROR OFF
2080*FX4,0
2090VDU26
2100CLS
2110REPORT:PRINT" at line ";ERL
2120END
2130DEFPROCtable:CLS
2140PRINT"
2150PRINT"
2160PRINT"
";
2170PRINT" 0 1 2 3 4 5 6 7 8
9 10 ";
2180PRINT"
";
2190PRINT" 1 1 2 3 4 5 6 7 8
9 10 ";
2200PRINT"
";
2210PRINT" 2 2 4 6 8 10 12 14 16 1
8 20 ";
2220PRINT"
";
2230PRINT" 3 3 6 9 12 15 18 21 24 2
7 30 ";
2240PRINT"
";
2250PRINT" 4 4 8 12 16 20 24 28 32 3
6 40 ";
2260PRINT"
";
2270PRINT" 5 5 10 15 20 25 30 35 40 4
5 50 ";
2280PRINT"
";
2290PRINT" 6 6 12 18 24 30 36 42 48 5
4 60 ";
2300PRINT"
";
2310PRINT" 7 7 14 21 28 35 42 49 56 6
3 70 ";
2320PRINT"
";
2330PRINT" 8 8 16 24 32 40 48 56 64 7
2 80 ";
2340PRINT"
";
2350PRINT" 9 9 18 27 36 45 54 63 72 8
1 90 ";
2360PRINT"
";
2370PRINT" 10 10 20 30 40 50 60 70 80 9
0 100 ";
2380PRINT" Press space";
2390REPEAT:A$=GET$:UNTIL A$=" ":RUN:END
PROC