MATHTEST

See all articles from SINCUS v2 n3

This program is an extension of a program some of us got with the early TIMEX-Sinclair 1000. It is a math drill that has 3 levels of difficulty. If you type carefully, using the KEY words and not spelling things like “INPUT”, this should RUN in 2K. You may have to drop lines 325 and 330 to RUN at the 3rd level of difficulty which is numbers up to 999! Note the subroutine at 1000 that avoids the possiblity of a negative answer!

2K EXPRESS

15 RANDOMIZE
20 PRINT "NAME PLEASE?"
25 INPUT N$
50 PRINT N$;" HOW HARD A PUZZLE"
55 PRINT "DO YOU WANT?"
60 PRINT ,,"EASY INPUT 1"
[illegible]5 PRINT ,,"MEDIUM INPUT 2"
[illegible] PRINT ,,"HARD INPUT 3"
[illegible]5 INPUT B
80 LET F=0
85 LET N=0
90 LET A$="+-*/"
95 PRINT ,,"SELECT TYPE OF PUZZLE:"
100 PRINT ,,"ADD INPUT 1"
110 PRINT ,,"SUBTRACT INPUT 2"
115 PRINT ,,"MULTIPLY INPUT 3"
120 PRINT ,,"DIVIDE INPUT 4"
125 INPUT A
135 CLS
140 LET N=N+1
145 PRINT "PUZZLE NO.: ";N,"CORRECT: ";F
150 LET C=INT (10↑B*RND+1)
155 LET D=INT (10↑B*RND+1)
160 IF A=4 AND B=1 THEN GO SUB 1000
170 IF A=2 THEN GO SUB 1000
175 LET B$=STR$ C+" "+A$(A)+" "+STR$ D
185 PRINT AT 10,10;B$;" = ";
190 INPUT E
195 PRINT E
200 IF ABS (VAL B$-E)>0.01 THEN GO TO 2000
210 FOR T=1 TO 5
220 PRINT AT 12,12;" O CORRECT"
225 PRINT AT 13,12;"[illegible]"
230 PRINT AT 14,12;"[illegible]"
240 PRINT AT 15,12;"[illegible]"
[illegible]5 PAUSE 30
[illegible]0 PRINT AT 12,12;"[illegible]O[illegible] CORREC[illegible]
255 PRINT AT 13,12;"[illegible]"
260 PRINT AT 14,12;"[illegible]"
265 PRINT AT 15,12;"[illegible]"
270 NEXT T
275 PAUSE 100
280 LET F=F+1
290 IF F<10 THEN GO TO 135
300 CLS
305 PRINT "GOOD WORK, ";N$
310 PRINT "YOU GOT 10 RIGHT OUT OF ";N
315 PRINT "YOUR SCORE:";(100*(F/N));" PER CENT"
320 PRINT AT 10,0;" TO GO AGAIN PRESS [illegible]"
325 GO TO 1
330 SAVE "MATHTES[illegible]"
335 RUN
1000 IF C>=D THEN RETURN
1010 LET X=C
1015 LET Y=D
1020 LET D=X
1025 LET C=Y
1030 RETURN
2000 PRINT ,"WRONG"
2010 FOR R=1 TO 5
2020 PRINT ,,"CORRECT ANSWER IS ";VAL B$
2025 PRINT ,,B$;" = ";ABS (VAL B$)
2030 PAUSE 125
2035 IF B=3 THEN PAUSE 400
2[illegible]40 CLS
[illegible]5 IF B=3 THEN GO TO 140
[illegible]0 NEXT R
[illegible]60 GO TO 135

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.