Math Attack
- Type
- Education
- Category
- Arithmetic flash cards and self-grading test
- Author
- Ralph B. Davis Sr.
- Published in
- Antic, January 1987 (Vol. 5, No. 9)
- Year
- 1987
- Language
- Atari BASIC
- Requirements
- 48K RAM (per the article), Atari BASIC; disk or cassette
- Tags
- antic, education, math, arithmetic, flash-cards, quiz, graphics-2, children, 1987
About the program
"As a father of four," Ralph Davis wrote, "I have reason to believe that children need more educational software." Math Attack was his answer. It drills addition, subtraction, multiplication and whole-number division, either as flash cards or as a ten-question test that the computer marks. Davis owned a furniture store in Tallahassee, Florida, and was vice president of the local Atari users' group. Antic printed the program in January 1987.
It works for any age, because you set the range of each number in the problem. In division you set the divisor and the quotient, so every problem comes out exactly. You also choose how long the computer waits before showing the answer. The same issue had a Talking Typewriter speech-synthesizer project, and a second listing, MATH.TLK, made Math Attack read the numbers aloud with it. That add-on is on the original disk but isn't reproduced here. The program below runs without it.
Typing it in
The listing is long but mostly plain BASIC. Inverse characters ({inv}…{/inv}: use the Atari or inverse key) are used for highlighted words and the coloured symbols. Line 1610 draws the division bracket with {CTRL-F} and {CTRL-M} (hold CTRL and press the letter), and {CTRL-R} makes the arrows in lines 950 and 1120. {CLEAR}, {DEL LINE}, {INS LINE} and {BELL} are typed by pressing ESC and then SHIFT-CLEAR, SHIFT-DELETE, SHIFT-INSERT or CTRL-2. The magazine printed TYPO II checksums, which aren't in the disk version. If you hold SELECT while you type RUN, the BREAK key stays enabled for debugging (lines 32–35).
How to use it
- After the animated title, press 1–4 for add, subtract, multiply or divide, then START.
- Type the low and high values for the top number, then for the bottom number. For division, these are the divisor and the quotient. Negative numbers are allowed, but fractions aren't. For subtraction, the bottom number can't be bigger than the top, so there are no negative answers.
- Choose a speed from 1 (fast) to 10 (slow). That's how long you get to think before the answer appears.
- Press F for flash cards or T for a test. In flash-card mode, problems keep coming until you press OPTION. That brings up a menu to reset the time, change the numbers, take a test or pick new math.
The test asks ten questions. Press SELECT to turn the answer timer on or off, then START. Your score comes with a comment from "better study" to a flashing "great!", and you can rewrite these in lines 690–770.
The listing here has one correction: as published, line 1540 had a leftover STOP that halted the program when you chose N (new math) from the OPTION menu. It now goes straight on (see "Changes from the published listing").
How it works
The problems are drawn in large GRAPHICS 2 text. Lines 190–340 work out where to POSITION each number so the digits line up in a column, depending on whether they have one, two or three digits. Division builds the dividend as divisor × quotient (DIV=X*Y) and draws the long-division bracket with diagonal slashes. In flash-card mode the delay is a FOR loop of TIME×100 passes, which also checks the console keys (53279) so that OPTION can interrupt. In the test, the timer counts how long the keyboard stays idle (location 764) before calling "time's up". Right and wrong answers get different sound effects, and the screen colour flickers using the hardware random number at 53770.
Variations to try
Change the messages in lines 690–770, or make the test longer by raising the 10 in line 380 (and the SC*10 scoring in line 680 to match).
Changes from the published listing
| Line | As published | Now | Why |
|---|---|---|---|
| 1540 | …THEN STOP :GOSUB 2070:… |
…THEN GOSUB 2070:… |
A leftover debugging STOP halted the program whenever you chose new math. |
Listing
10 REM MATH ATTACK
20 REM BY RALPH B. DAVIS SR.
30 REM (c) 1986, ANTIC PUBLISHING
32 BRK=1:IF PEEK(53279)=5 THEN BRK=0
33 GOTO 40
35 POKE 77,0:IF BRK THEN POKE 16,112:POKE 53774,112
36 RETURN
40 DIM A$(20),B$(20),C$(1),W$(1),DIV$(12)
50 GOSUB 2060:REM MAIN TITLE
60 GOSUB 800:REM GRAPHICS
70 GOSUB 1930:REM TITLE SCREEN
80 GOSUB 890:REM SET UP
85 GOTO 2560
90 GOSUB 800:REM GRAPHICS
100 Y=INT(RND(1)*(HT-LT+1))+LT
110 X=INT(RND(1)*(HB-LB+1))+LB
115 IF CT=4 AND X*Y=0 THEN 100
120 ON CT GOTO 130,140,160,170
130 POSITION 6,5:? #6;"{inv}+{/inv}":POSITION 2,1:? #6;" addition ":W=X+Y:GOTO 180
140 IF X>Y THEN 100
150 POSITION 6,5:? #6;"{inv}-{/inv}":POSITION 2,1:? #6;" subtraction ":W=Y-X:GOTO 180
160 POSITION 6,5:? #6;"{inv}X{/inv}":POSITION 2,1:? #6;"multiplication":W=X*Y:GOTO 180
170 POSITION 2,1:? #6;" DIVISION ":POSITION 2,11:? #6;"{inv}OPTION TO{/inv} EXIT":DIV=X*Y:GOSUB 1680:GOTO 260
180 POSITION 2,11:? #6;"{inv}OPTION TO{/inv} EXIT"
190 IF Y>9 THEN POSITION 8,3:? #6;Y:GOTO 210
200 POSITION 9,3:? #6;Y
210 IF Y>99 AND X<10 THEN POSITION 10,5:? #6;X:GOTO 250
220 IF Y>99 AND X<99 THEN POSITION 9,5:? #6;X:GOTO 250
230 IF X>9 THEN POSITION 8,5:? #6;X:GOTO 250
240 POSITION 9,5:? #6;X
250 POSITION 8,6:? #6;"{inv}__{/inv}"
260 FOR T=1 TO OUT
270 IF PEEK(53279)=3 THEN GOTO 1400
280 NEXT T:GOSUB 780
290 IF CT=4 THEN POSITION 8,4:? #6;X:GOTO 350
300 IF W<10 THEN POSITION 9,7:? #6;W:GOTO 350
310 IF W>99 AND X>9 AND X<100 AND Y>9 AND Y<100 THEN POSITION 7,7:? #6;W:POSITION 7,6:? #6;"{inv}_{/inv}":GOTO 350
320 IF W<100 THEN POSITION 8,7:? #6;W:POSITION 10,6:? #6;"{inv}_{/inv}":GOTO 350
330 IF W>99 THEN POSITION 8,7:? #6;W:POSITION 10,6:? #6;"{inv}_{/inv}":GOTO 350
340 POSITION 8,7:? #6;W
350 FOR T=1 TO 1000:NEXT T
360 GOSUB 800:GOTO 90
370 OUT=TIME*50
380 FOR ZT=1 TO 10
390 GOSUB 830:TM=0
400 POSITION 3,1:? #6;" now testing "
410 POSITION 1,3:? #6;"NO.";ZT
420 Y=INT(RND(1)*(HT-LT+1))+LT
430 X=INT(RND(1)*(HB-LB+1))+LB
435 IF CT=4 AND X*Y=0 THEN 420
440 ON CT GOTO 450,460,480,490
450 POSITION 6,6:? #6;"+":W=X+Y:GOTO 500
460 IF X>Y THEN 420
470 POSITION 6,6:? #6;"-":W=Y-X:GOTO 500
480 POSITION 6,6:? #6;"X":W=X*Y:GOTO 500
490 DIV=Y*X:GOSUB 1690:GOTO 570
500 IF Y>9 THEN POSITION 8,5:? #6;Y:GOTO 520
510 POSITION 9,5:? #6;Y
520 IF Y>99 AND X<10 THEN POSITION 10,7:? #6;X:GOTO 560
530 IF Y>99 AND X<99 THEN POSITION 9,7:? #6;X:GOTO 560
540 IF X>9 THEN POSITION 8,7:? #6;X:GOTO 560
550 POSITION 9,7:? #6;X
560 POSITION 8,8:? #6;"__"
570 POKE 752,1:? :? :POSITION 22,2:? "{inv} ENTER ANSWER {/inv}"
580 IF TIM=2 THEN 610
590 POKE 764,255
600 IF PEEK(764)=255 THEN 1780
610 TRAP 640:INPUT ANS:? :? :? :?
620 IF CT=4 AND ANS=X THEN 660
630 IF CT<>4 AND ANS=W THEN 660
640 POSITION 11,3:? #6;" {inv}wrong{/inv} !":GOSUB 840:GOSUB 790:GOSUB 820:NEXT ZT:GOTO 670
650 GOSUB 790:GOSUB 840:GOSUB 820:NEXT ZT:GOTO 670
660 POSITION 10,3:? #6;" {inv}correct {CTRL-A}{/inv}":GOSUB 840:GOSUB 792:SC=SC+1:NEXT ZT:GOTO 670
670 GOSUB 830
680 SCORE=SC*10
690 IF SCORE<70 THEN POSITION 3,3:? #6;"better study":GOTO 730
700 IF SCORE<90 THEN POSITION 3,3:? #6;"not bad !!!!":GOTO 730
710 IF SCORE=90 THEN POSITION 3,3:? #6;"very good!!!":GOTO 730
720 IF SCORE=100 THEN 750
730 POSITION 7,5:? #6;"{inv}score{/inv}":POSITION 8,7:? #6;SCORE;"%"
740 GOSUB 810:SC=0:GRAPHICS 0:GOTO 1400
750 FOR GT=1 TO 3
760 POSITION 3,3:? #6;" ":GOSUB 780
770 POSITION 3,3:? #6;"{inv}!{/inv}! {inv}g{/inv}r{inv}e{/inv}a{inv}t{/inv} {inv}!{/inv}!{inv}!{/inv}":GOSUB 792:NEXT GT:GOTO 730
780 SOUND 0,1,6,10:FOR T=1 TO 10:NEXT T:SOUND 0,0,0,0:RETURN
790 POKE 708,PEEK(711):FOR T=30 TO 0 STEP -1:SOUND 0,50,6,T/2:SOUND 1,10,12,T/2:POKE 711,PEEK(20)
791 NEXT T:POKE 711,PEEK(708):RETURN
792 FOR T=-2 TO 23:VOL=((ABS(T)>0)*(T<20))*14:POKE 711,PEEK(53770)
793 SOUND 0,60,14,VOL:SOUND 1,47,14,VOL:SOUND 2,40,14,VOL:SOUND 3,29,14,VOL:NEXT T:RETURN
800 GRAPHICS 18:GOSUB 35:POKE 711,152:COLOR 2:RETURN
810 FOR T=1 TO 800:NEXT T:RETURN
820 FOR T=1 TO 200:NEXT T:RETURN
830 GRAPHICS 2:GOSUB 35:POKE 712,112:POKE 710,112:RETURN
840 IF CT=4 THEN POSITION 9,4:? #6;X:RETURN
850 IF W<10 THEN POSITION 9,9:? #6;W:RETURN
860 IF W<100 THEN POSITION 8,9:? #6;W:RETURN
870 IF X>99 OR Y>99 THEN POSITION 8,9:? #6;W:RETURN
880 POSITION 7,9:? #6;W:RETURN
890 GRAPHICS 0:POKE 712,66:POKE 710,144
900 GOSUB 35:ON CT GOTO 910,920,930,940
910 POSITION 9,1:? "{inv} SETTING UP ADDITION {/inv}":GOTO 950
920 POSITION 8,1:? "{inv} SETTING UP SUBTRACTION {/inv}":GOTO 950
930 POSITION 6,1:? "{inv} SETTING UP MULTIPLICATION {/inv}":GOTO 950
940 POSITION 5,1:? "{inv} SETTING UP INTEGER DIVISION {/inv}":GOSUB 1610:GOTO 1020
950 POSITION 12,3:? "TOP NO. {CTRL-R}> "
960 POSITION 9,5:? "BOTTOM NO. "
970 POSITION 23,6:? "___ "
980 POSITION 3,9:? "To play MATH ATTACK, you must first type in the range of the TOP number."
990 ? "Next, type in the range of the BOTTOM number."
1000 ? "I'll use numbers which fall within":? "these ranges to create math questions for you."
1010 POSITION 2,16:? " Then I'll let you select how much":? "time you'll have to answer each one."
1020 DIV$="{inv} TOP NO. {/inv}":IF CT=4 THEN DIV$="{inv} DIVISOR {/inv} "
1025 POSITION 2,19:? "{inv} ENTER {/inv} LOW SIDE OF ";DIV$:GOSUB 1600:TAP=1
1030 TRAP 1020:POSITION 2,20:? "{DEL LINE}{DEL LINE}{DEL LINE}":INPUT LT:TRAP 1560
1035 IF CT=4 THEN IF LT=0 OR LT<>INT(LT) THEN GOSUB 3000:GOTO 1025
1040 IF CT=4 THEN POSITION 12,4:? LT;"-":GOTO 1060
1050 POSITION 23,3:? LT;" - "
1060 POSITION 2,19:? "{inv} ENTER {/inv} HIGH SIDE OF ";DIV$:TAP=2:GOSUB 1600
1070 TRAP 1040:POSITION 6,20:? "{DEL LINE}{DEL LINE}{DEL LINE}":INPUT HT:TRAP 1560
1075 IF CT=4 THEN IF HT=0 OR HT<>INT(HT) THEN GOSUB 3000:GOTO 1060
1080 IF CT=4 THEN POSITION 12,4:? LT;"-";HT:GOTO 1100
1090 POSITION 23,3:? LT;" - ";HT
1100 IF HT<LT THEN GOSUB 1750:GOTO 1060
1110 IF CT=4 THEN POSITION 31,3:? "<{CTRL-R}":POSITION 8,5:? " ":GOTO 1130
1120 POSITION 20,5:? "{CTRL-R}>":POSITION 20,3:? " "
1130 DIV$="{inv} BOTTOM NO. {/inv}":IF CT=4 THEN DIV$="{inv} QUOTIENT {/inv} "
1135 POSITION 2,19:? "{inv} ENTER {/inv} LOW SIDE OF ";DIV$:TAP=3:GOSUB 1600
1140 TRAP 1110:POSITION 2,20:? "{DEL LINE}{DEL LINE}{DEL LINE}":INPUT LB:TRAP 1560
1145 IF CT=4 THEN IF LB=0 OR LB<>INT(LB) THEN GOSUB 3000:GOTO 1135
1150 IF CT=2 THEN 1170
1160 GOTO 1180
1170 IF LB>HT THEN 1570
1180 IF CT=4 THEN POSITION 23,2:? LB;"-":GOTO 1200
1190 POSITION 23,5:? LB;" - "
1200 POSITION 2,19:? "{inv} ENTER {/inv} HIGH SIDE OF ";DIV$:TAP=4:GOSUB 1600
1210 TRAP 1180:POSITION 2,21:? "{DEL LINE}{DEL LINE}{DEL LINE}":INPUT HB:TRAP 1560
1212 IF CT=4 THEN IF HB=0 OR HB<>INT(HB) THEN GOSUB 3000:GOTO 1200
1215 IF CT=2 THEN 1230
1220 GOTO 1240
1230 IF HB>HT THEN 1570
1240 POKE 752,1:POSITION 2,19:? " "
1250 IF CT=4 THEN POSITION 23,2:? LB;"-";HB:GOTO 1280
1260 POSITION 23,5:? LB;" - ";HB
1270 IF HB<LB THEN GOSUB 1750:GOTO 1200
1280 GOSUB 820
1290 POKE 712,66:POKE 710,144:POKE 752,0:? "{CLEAR}":? :? " {inv} NOW SELECT SPEED {/inv}"
1300 ? :? "This is length of time I give you":? "to think about the problem."
1310 ? :? "When the time runs out,":? "I'll tell you the correct answer."
1320 TIME=0:OUT=0:TAP=5
1330 ? :? :? " Choose speed (1 - 10)"
1340 ? :? " 1 = {inv} FAST {/inv}"
1350 ? :? " 10 = {inv} SLOW {/inv}"
1360 ? :? "How fast are {inv} YOU? {/inv}":GOSUB 1770
1370 TRAP 1360:POSITION 2,19:? "{DEL LINE}{INS LINE}";:INPUT TIME:OUT=TIME*100
1375 IF TIME<1 OR TIME>10 THEN GOSUB 790:GOTO 1360
1380 RETURN
1390 REM RETURN CHOICE
1400 ? "{CLEAR}":POKE 712,66:POKE 710,144:? :? :? :POKE 752,1
1410 ? :? " PRESS"
1420 ? :? " {inv}[R]{/inv} TO {inv} RESET TIME {/inv}"
1430 ? :? " {inv}[C]{/inv} TO {inv} CHANGE INPUT NOS. {/inv}"
1440 ? :? " {inv}[T]{/inv} TO {inv} TAKE TEST {/inv}"
1450 ? :? " {inv}[N]{/inv} TO {inv} NEW MATH {/inv}"
1460 POKE 752,1
1470 CLOSE #1:OPEN #1,4,0,"K:":GOSUB 35
1480 GET #1,N
1490 B$=CHR$(N):CLOSE #1
1500 POKE 752,0
1510 IF B$="R" OR B$="r" THEN GOSUB 1290:GOTO 2560
1520 IF B$="T" OR B$="t" THEN 1830
1530 IF B$="C" OR B$="c" THEN GOSUB 890:GOTO 2560
1540 IF B$="N" OR B$="n" THEN GOSUB 2070:GOSUB 890:GOTO 2560
1550 GOTO 1460
1560 GOSUB 1750:ON TAP GOTO 1020,1060,1130,1200,1370
1570 POSITION 6,21:? "NUMBER MUST BE SMALLER !":GOSUB 780:GOSUB 820:POSITION 6,21:? " "
1580 IF TAP=4 THEN 1200
1590 GOTO 1130
1600 POSITION 2,21:? " ":RETURN
1610 POSITION 11,4:? " {CTRL-F}{CTRL-M}{CTRL-M}{CTRL-M}{CTRL-M}{CTRL-M}{CTRL-M}{CTRL-M}{CTRL-M}":REM CTRL-F, CTRL-M
1620 POSITION 22,3:? "QUOTIENT"
1630 POSITION 8,5:? "{CTRL-R}> DIVISOR {CTRL-F} DIVIDEND"
1640 POSITION 18,6:? "{CTRL-F}":REM CTRL-F
1650 POSITION 2,9:? " FIRST Enter the range of the {inv} DIVISOR {/inv}"
1660 POSITION 2,12:? " THEN Enter the range of the {inv} QUOTIENT {/inv}"
1670 POSITION 2,15:? "THEN I will let you SELECT how much TIME you need":RETURN
1680 POSITION 8,5:? #6;"{inv}______{/inv}":POSITION 5,8:? #6;"{inv}/{/inv}":POSITION 6,7:? #6;"{inv}/{/inv}":POSITION 7,6:? #6;"{inv}/{/inv}":GOTO 1700
1690 POSITION 8,5:? #6;"______":POSITION 5,8:? #6;"/":POSITION 6,7:? #6;"/":POSITION 7,6:? #6;"/"
1700 IF Y<10 THEN POSITION 4,6:? #6;Y:GOTO 1730
1710 IF Y<100 THEN POSITION 3,6:? #6;Y:GOTO 1730
1720 POSITION 1,7:? #6;Y
1730 POSITION 8,7:? #6;DIV
1740 RETURN
1750 POSITION 6,21:? "NUMBER MUST BE LARGER !":GOSUB 780:GOSUB 820:POSITION 6,21:? " "
1760 RETURN
1770 FOR FL=1 TO 5:POKE 755,0:FOR T=1 TO 5:NEXT T:POKE 755,2:NEXT FL:RETURN
1780 TM=TM+1
1790 IF TM=OUT THEN 1810
1800 GOTO 600
1810 IF CT=4 THEN POSITION 11,8:? #6;"{inv}times{/inv}":POSITION 12,9:? #6;"{inv}up{/inv} !":TM=0:GOTO 650
1820 POSITION 12,5:? #6;"{inv}times{/inv}":POSITION 14,7:? #6;"{inv}up{/inv} !":TM=0:GOTO 650
1830 POKE 752,1:? "{CLEAR}":POKE 712,52:? :? :? " {inv} READY TO TAKE TEST {/inv}"
1840 ? :? :? " I'LL NOW GIVE YOU 10 PROBLEMS, YOU'RE TO FILL IN THE CORRECT ANSWERS THEN I WILL GRADE YOU."
1850 ? :? :? "PRESS {inv} START {/inv} TO BEGIN."
1860 POSITION 5,14:? "PRESS {inv} SELECT {/inv} FOR TIMER":POSITION 9,16:? "TIMER {inv} ON {/inv} "
1870 IF PEEK(53279)=5 THEN TIM=TIM+1:IF TIM=3 THEN TIM=1
1880 IF TIM=2 THEN POSITION 15,16:? "{inv} OFF {/inv}"
1890 IF TIM=1 THEN POSITION 15,16:? "{inv} ON {/inv} "
1900 IF PEEK(53279)=6 THEN 370
1910 FOR XT5=1 TO 12:NEXT XT5:GOTO 1870
1920 REM TITLE SCREEN
1930 GOSUB 35:ON CT GOTO 1940,1950,1960,1970
1940 POSITION 4,5:? #6;" ADDITION ":C$="+":W$="{inv}+{/inv}":GOTO 1980
1950 POSITION 3,5:? #6;" SUBTRACTION ":C$="-":W$="{inv}-{/inv}":GOTO 1980
1960 POSITION 3,5:? #6;"MULTIPLICATION":C$="x":W$="{inv}X{/inv}":GOTO 1980
1970 POSITION 3,5:? #6;" DIVISION ":C$="%":W$="{inv}%{/inv}":GOTO 1980
1980 COLOR ASC(W$):PLOT 1,1:DRAWTO 18,1:DRAWTO 18,10:DRAWTO 1,10:DRAWTO 1,1
1990 REM COLORS
2000 FOR VV=2 TO 18 STEP 2:POSITION VV,1:? #6;C$:GOSUB 780:NEXT VV:FOR BB=2 TO 10 STEP 2:POSITION 18,BB:? #6;C$
2010 GOSUB 780:NEXT BB
2020 FOR VC=18 TO 1 STEP -2:POSITION VC,10:? #6;C$:GOSUB 780:NEXT VC:FOR VB=10 TO 1 STEP -2
2030 POSITION 1,VB:? #6;C$:GOSUB 780:NEXT VB:GOSUB 820:RETURN
2050 REM TITLE SCREEN
2060 GOSUB 2330:REM MAIN TITLE
2070 GRAPHICS 0:GOSUB 2550
2080 GOSUB 2310
2090 POSITION 3,6:? #6;"1. + add +"
2100 POSITION 3,9:? #6;"2. - subtract -"
2110 POSITION 3,12:? #6;"3. X multiply X"
2120 POSITION 3,15:? #6;"4. % divide %"
2130 FOR HJ=1 TO 4:GOSUB 2320:GOSUB 2540:GOSUB 2310:NEXT HJ
2140 CLOSE #1:OPEN #1,4,0,"K:"
2150 GET #1,N
2160 A$=CHR$(N)
2170 CLOSE #1
2180 IF A$="1" THEN CT=1:GOSUB 2270:GOTO 2230
2190 IF A$="2" THEN CT=2:GOSUB 2280:GOTO 2230
2200 IF A$="3" THEN CT=3:GOSUB 2290:GOTO 2230
2210 IF A$="4" THEN CT=4:GOSUB 2300:GOTO 2230
2220 GOTO 2140
2230 FOR P=1 TO 5:POSITION 3,20:? #6;" ":GOSUB 2540:POSITION 3,20:? #6;"{inv}PRESS START{/inv}":NEXT P
2240 IF PEEK(53279)=6 THEN RETURN
2250 IF PEEK(53279)=5 THEN POSITION 3,20:? #6;" ":GOTO 2080
2260 GOTO 2240
2270 POSITION 8,6:? #6;"ADD":RETURN
2280 POSITION 8,9:? #6;"SUBTRACT":RETURN
2290 POSITION 8,12:? #6;"MULTIPLY":RETURN
2300 POSITION 8,15:? #6;"DIVIDE ":RETURN
2310 POSITION 5,2:? #6;"{inv}select !{/inv}":RETURN
2320 POSITION 5,2:? #6;" ":RETURN
2330 GOSUB 2550
2340 REM VERTICAL MOVE
2350 YY=24:FOR XX=22 TO 8 STEP -2:GOSUB 2490:YY=YY-2
2360 GOSUB 2500:NEXT XX
2370 REM FLASH
2380 GOSUB 2510
2390 REM HORIZONTAL MOVE
2400 FOR X=17 TO 8 STEP -1:POSITION X,18:? #6;"{inv}BY{/inv}":POSITION X+2,18:? #6;" ":NEXT X:GOSUB 2520
2410 FOR Y=13 TO 1 STEP -1:POSITION Y,20:? #6;"RALPH ":NEXT Y
2420 FOR V=17 TO 7 STEP -1:POSITION V,20:? #6;"B. ":NEXT V
2430 FOR G=13 TO 10 STEP -1:POSITION G,20:? #6;"DAVIS ":NEXT G
2440 POSITION 16,20:? #6;"SR.":GOSUB 2520
2450 POSITION 1,3:? #6;"+ {inv}-{/inv} x % + {inv}-{/inv} x % +"
2460 POSITION 1,11:? #6;"+ {inv}-{/inv} x % + {inv}-{/inv} x % +"
2470 GOSUB 2510:REM FLASH #2
2480 FOR T=1 TO 30:NEXT T:RETURN
2490 POSITION 3,XX:? #6;"MATH ATTACK !":SOUND 0,XX,6,10:RETURN
2500 POSITION 3,YY:? #6;" ":SOUND 0,0,0,0:RETURN
2510 FOR Z=1 TO 10:YY=7:GOSUB 2500:GOSUB 2490:NEXT Z
2520 FOR JW=15 TO 0 STEP -2.5:FOR J=2 TO 0 STEP -1:SOUND 0,1+13-J,10,JW:NEXT J:NEXT JW:RETURN
2530 FOR T=1 TO 2:NEXT T:RETURN
2540 SOUND 0,10,2,8:GOSUB 2530:SOUND 0,0,0,0:RETURN
2550 GRAPHICS 1+16:GOSUB 35:POKE 711,152:COLOR 4:POKE 711,140:COLOR 3:POKE 711,136:COLOR 4:RETURN
2560 POKE 752,1:? "{CLEAR}":POKE 710,144:POKE 712,66
2570 ? :? :? :? :? "Press":? :? " {inv}[F]{/inv} FOR FLASH CARDS":? :? " {inv}[T]{/inv} FOR TEST"
2580 CLOSE #1:OPEN #1,4,0,"K:"
2590 GET #1,N
2600 B$=CHR$(N):CLOSE #1
2610 IF B$="F" OR B$="f" THEN 90
2620 IF B$="T" OR B$="t" THEN 1830
2630 GOTO 2580
3000 POSITION 2,19:? "{inv} NON-ZERO INTEGERS ONLY {/inv}{BELL}{BELL}{DEL LINE}";:RETURN
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: MATH.BAS.
Credits
- Program listing: Math Attack — program listing (Antic, January 1987 (Vol. 5, No. 9)) — Ralph B. Davis Sr.
- Picture: A multiplication flash card after the thinking time has run out and the answer has appeared. — Ralph B. Davis Sr. (program); screenshot by the site
- Antic, January 1987 (Vol. 5 No. 9): Math Attack, by Ralph Davis (atarimagazines.com) — Ralph B. Davis Sr., 1987
- Antic Software Archive — January 1987 - Vol. 5 No. 9 disk: MATH.BAS (MATH.TLK talking version not reproduced) — AtariMagazines.com (Kevin Savetz), 1987
