Fun with Maths (Zábavná matika)
- Type
- Education
- Category
- Arithmetic drill for children
- Author
- Peter Watts (Czech translation by J. Cibulka)
- Published in
- Atari User (UK) as "Fun with Maths"; Czech version by AK Třebíč on the disk magazine Flop, issue 1
- Language
- Atari BASIC
- Requirements
- Any 8-bit Atari with Atari BASIC; keyboard
- Tags
- education, mathematics, children, quiz, atari-user, czech, flop, atari-basic, graphics-1
About the program
The REMs tell the story: "FUN WITH MATHS / ZABAVNA MATIKA, BY PETER WATTS, PREL. J.CIBULKA, (c) ATARI USER, AK TREBIC". This is a British magazine type-in, translated (přeložil) into Czech by J. Cibulka of the Atari club in Třebíč and passed round on the first issue of the Czech disk magazine Flop. The child types their name, picks an operation and a level, and answers ten sums in big GRAPHICS 1 text. They get up to three tries per sum, with a cheerful rising tone for a right answer and a buzz for a wrong one. At the end the program shows the score, the time taken and the best time so far, plus a verdict.
Screen text in English
| Czech | English |
|---|---|
| VLOZ SVE JMENO / A ZMACKNI RETURN | Type your name / and press RETURN |
| 1.scitani 2.odcitani 3.nasobeni 4.deleni 5.ruzne operace | 1 addition, 2 subtraction, 3 multiplication, 4 division, 5 mixed |
| OBTIZNOST / TABULKA NASOBKU | Difficulty / times table (of the level number) |
| ODPOVED JE SPRAVNE / NESPRAVNA ODPOVED / ODPOVED JE … | Correct! / Wrong answer / The answer is … |
| … POCITAL · MINUT · SEKUND · NEJKRATSI CAS | … did the sums in · minutes · seconds · fastest time |
| VYMEN MOZEK · SNAZ SE VIC · VELMI DOBRE · JSI KOUZELNIK | "Swap your brain!" · Try harder · Very good · You're a wizard |
| POKRACUJEME? (A/N) | Carry on? (A = yes, N = no) |
Typing it in
The listing is plain ASCII. Several PRINT #6;" " statements (lines 1040, 1050, 2040, 2080 and others) were meant to blank a whole line of the GRAPHICS 1 screen with a row of spaces. The spacing has been squeezed to a single space in the copy reproduced here, and the same happened to the row of asterisks in the title (line 10), so old messages may be left on screen. Pad those strings to 20 spaces to tidy it up.
How to use it
Type a name and press RETURN. Choose 1–5. Press SELECT to step the level from 1 to 12, then START. Type each answer as digits (the program knows how many digits to expect), and use DELETE/BACKSPACE to start the answer again. A sum scores 10 points, minus 4 for each wrong try. Score 90 or more and the next round goes up a level automatically (except in times-table mode, where the level is the table).
How it works
- Big text on top: line 80 patches two lines of the GRAPHICS 1 display list to ANTIC mode 7 (GRAPHICS 2 size) for the heading and the sum.
- Timer:
POKE 19,0:POKE 20,0resets the real-time clock at the start. At the end, the elapsed jiffies are turned into minutes and seconds by dividing by 3000 and 50. That's the 50 Hz PAL frame rate, a giveaway of the program's British origin. On an NTSC machine the times read about 20% high. Use 3600 and 60 instead. - Answer entry:
GET #2from the keyboard andPUT #6to echo each digit, with noINPUTprompt to confuse young children.
Listing
1 REM FUN WITH MATHS ZABAVNA MATIKA
2 REM BY PETER WATTS PREL. J.CIBULKA
3 REM (c)ATARI USER AK TREBIC
5 DIM N$(12),TXT$(20),Z$(5):HJIF=30000:OPEN #2,4,0,"K:"
10 GRAPHICS 17:SETCOLOR 3,7,8:POSITION 2,0:? #6;"**************** *zabavna matika* ****************"
15 POSITION 3,8:? #6;"VLOZ SVE JMENO":POSITION 2,10:? #6;"A ZMACKNI RETURN"
20 POSITION 4,17:? #6;"------------":POSITION 4,16:TRAP 35
25 GET #2,K:IF K=155 THEN 35
30 N$(LEN(N$)+1)=CHR$(K):? #6;CHR$(K);:GOTO 25
35 POSITION 5,5:? #6;"N A S T A V":POSITION 2,8:? #6;"1.scitani "
40 POSITION 2,10:? #6;"2.odcitani ":POSITION 2,12:? #6;"3.nasobeni"
45 POSITION 2,14:? #6;"4.deleni":POSITION 2,16:? #6;"5.ruzne operace "
50 L=1:GET #2,K:S=K-48:IF S<1 OR S>5 THEN 50
55 IF PEEK(53279)=5 THEN SOUND 0,150-5*L,14,7:L=L+1:IF L>12 THEN L=1
60 POSITION 2,19:? #6;"select = LEVEL ";L;" ":POSITION 0,22:? #6;"PRESS start TO BEGIN"
65 FOR T=1 TO 25:NEXT T:SOUND 0,0,0,0
70 IF PEEK(53279)<>6 THEN 55
75 GRAPHICS 17:SETCOLOR 0,1,6:SETCOLOR 2,12,8:SETCOLOR 4,0,10
80 DLIST=PEEK(560)+PEEK(561)*256:POKE DLIST+6,7:POKE DLIST+15,7:POKE 19,0:POKE 20,0
85 SC=0:FOR I=1 TO 10:TRY=0
90 IF S<>3 THEN POSITION 5,4:? #6;"OBTIZNOST ";L
95 POSITION 0,1:GOSUB S*100:POSITION 6,20:? #6;"SUM NO.";I:GOSUB 900:NEXT I:GOTO 600
100 ? #6;" **SCITANI**"
110 X=INT(11*RND(0)*L)
120 Y=INT(11*RND(0)*L)
130 POSITION 5,10:? #6;X;"+";Y;"="
140 A=X+Y:RETURN
200 ? #6;" **ODECITANI**"
210 X=INT(12*RND(0)*L+1)
220 Y=INT(10*RND(0)*L)
225 IF Y>X THEN 220
230 POSITION 5,10:? #6;X;"-";Y;"="
240 A=X-Y:RETURN
300 ? #6;" **NASOBENI**"
310 X=INT(RND(0)*13):Y=L
320 IF S<>5 THEN POSITION 1,4:? #6;"TABULKA NASOBKU ";L
330 POSITION 3,10:? #6;X;" X ";Y;" ="
340 A=X*Y:RETURN
400 ? #6;" **DELENI** "
410 Y=INT(9*RND(0)+L)
420 X=Y*INT(8*RND(0)+L)
430 POSITION 4,10:? #6;X;"/";Y;" ="
440 A=X/Y:RETURN
500 N=INT(RND(0)*4+1):GOTO N*100
600 REM END ROUTINE
610 GRAPHICS 17:SETCOLOR 0,2,8:SETCOLOR 1,1,8:SETCOLOR 2,8,6:SETCOLOR 3,12,8
620 JIF=256*PEEK(19)+PEEK(20)
630 MIN=INT(JIF/3000):SEC=INT((JIF-MIN*3000)/50)
640 IF JIF<HJIF THEN HJIF=JIF:HMIN=MIN:HSEC=SEC
650 POSITION 0,0:? #6;N$;" POCITAL"
660 POSITION 1,2:? #6;MIN;" MINUT ";SEC;" SEKUND"
670 POSITION 4,9:? #6;"NEJKRATSI CAS"
680 POSITION 1,11:? #6;HMIN;" MINUT ";HSEC;" SEKUND"
700 IF SC<40 THEN TXT$="VYMEN MOZEK"
710 IF SC>40 THEN TXT$="SNAZ SE VIC"
720 IF SC>69 THEN TXT$="VELMI DOBRE"
730 IF SC>89 THEN TXT$="JSI KOUZELNIK"
740 POSITION 3,16:? #6;TXT$:POSITION 4,21:? #6;"POKRACUJEME ?":POSITION 7,23:? #6;"(A/N)"
750 POSITION 5,5:? #6;"SKORE =";SC:FOR T=1 TO 120:NEXT T
760 POSITION 12,5:? #6;" ":FOR T=1 TO 60:NEXT T
770 IF PEEK(764)=255 THEN 750
780 GET #2,K:IF K=78 OR K=110 THEN 10
790 IF SC>89 THEN IF S<>3 THEN L=L+1
795 GOTO 75
900 REM GET AND CECK ANSWER
910 POSITION 13,10:? #6;" "
920 POSITION 13,10:Z$=" ":DIGIT=1:POKE 764,255
930 IF A>9 THEN DIGIT=2
940 IF A>99 THEN DIGIT=3
950 FOR N=1 TO DIGIT
960 GET #2,K:IF K=126 THEN 900
970 IF K<48 OR K>57 THEN 960
980 PUT #6,K:Z$(N,N)=STR$(K-48):NEXT N
990 IF A<>VAL(Z$) THEN TRY=TRY+1:GOTO 2000
1000 REM CORRECT ANSWER
1010 POSITION 2,15:? #6;"ODPOVED JE SPRAVNE"
1020 FOR T=200 TO 3 STEP -3:SOUND 0,T,10,10:POKE 711,T+17:NEXT T:SOUND 0,0,0,0
1030 FOR T=1 TO 100:NEXT T
1040 POSITION 0,15:? #6;" "
1050 POSITION 0,10:? #6;" "
1060 SC=SC+10-4*TRY
1070 RETURN
2000 REM INCORRECT ANSWER
2010 IF TRY<>3 THEN POSITION 1,15:? #6;"NESPRAVNA ODPOVED "
2020 IF TRY=3 THEN POSITION 2,15:? #6;"ODPOVED JE ";A
2030 FOR T=1 TO 45:SOUND 0,95,12,8:NEXT T:FOR T=1 TO 50:SOUND 0,85,12,8:NEXT T:SOUND 0,0,0,0
2040 FOR T=1 TO 100:NEXT T:POSITION 0,15:? #6;" "
2050 IF TRY<>3 THEN 900
2060 POSITION 13,10:? #6;A
2070 FOR T=1 TO 10:SOUND 0,50,8,12:NEXT T:SOUND 0,0,0,0:FOR T=1 TO 300:NEXT T
2080 POSITION 0,10:? #6;" "
2090 RETURN
Credits
- Program listing: Fun with Maths (Zábavná matika) — program listing (Atari User (UK) as "Fun with Maths"; Czech version by AK Třebíč on the disk magazine Flop, issue 1) — Peter Watts (Czech translation by J. Cibulka)
- Picture: The operation menu. The stray 'JMENO' and 'ETURN' are leftovers from the name screen: the blanking strings have lost their spaces (see Typing it in). — Peter Watts (Czech translation by J. Cibulka) (program); screenshot by the site
- Gury's Atari 8-bit Forever — Zabavna matika — Peter Watts (Czech translation by J. Cibulka)
