Arithmetrix, math game (ARITHMTX.BAS)
Arithmetrix, math game
Description
Arithmetrix, math game
From the Antic disk of October 1983 (Vol. 2 No. 7).
From the Antic Software Archive at atarimagazines.com. The program remains the property of its author and publisher.
What is in this file
Atari BASIC program · 4.5 KB
- Dialect
- Atari BASIC
- Lines
- 133
- Variables
LINE$,R$,C$,LM,Y,JIFFY,DISPLAY,X,LINE,LINES,DING,N,RESULT,RLINE,A,B,C,S,Q,Z,FINAL,DONE,BONG
BASIC listing (133 lines)
100 REM ARITHMETRIX by Jerry White
105 REM ANTIC MAGAZINE
110 REM Version date 5/25/83
120 REM
130 DIM LINE$(40),R$(4),C$(1):GOSUB 790:GOTO 270
140 REM
150 REM DISPLAY SUBROUTINE
160 REM
170 POKE 752,1:LM=INT(19-LEN(LINE$)/2):Y=Y+2:IF Y<24 THEN 190
180 JIFFY=120:GOSUB 760:? CHR$(125):Y=2
190 FOR DISPLAY=1 TO LEN(LINE$):X=LM+DISPLAY
200 C$=LINE$(DISPLAY,DISPLAY):IF C$="@" THEN C$=","
210 POSITION X,Y:? C$;:NEXT DISPLAY:RETURN
220 FOR LINE=1 TO LINES:READ LINE$:GOSUB 170
230 FOR DING=4 TO 0 STEP -1:SOUND 0,LINE,2,DING:NEXT DING:NEXT LINE:RETURN
240 REM
250 REM MAIN PROGRAM
260 REM
270 Y=0:LINES=10:GOSUB 220:? :GOSUB 860
280 REM
290 REM FIRST ALGORITHM
300 REM
310 LINES=2:GOSUB 220:GOSUB 820
320 N=SQR(RESULT+1):GOSUB 920
330 REM
340 REM SECOND ALGORITHM
350 REM
360 LINES=2:GOSUB 220
370 POKE 752,0:? :POKE 764,255:INPUT R$
380 IF R$(1,1)<>"O" AND R$(1,1)<>"E" THEN RLINE=410:GOTO 830
390 IF R$="O" THEN RESTORE 1120
400 IF R$="E" THEN RESTORE 1130
410 LINES=1:GOSUB 220
420 RESTORE 1140:LINES=3:GOSUB 220:GOSUB 820
430 IF R$(1,1)="O" THEN N=2*RESULT+1
440 IF R$(1,1)="E" THEN N=2*RESULT+2
450 GOSUB 920
460 REM
470 REM THIRD ALGORITHM
480 REM
490 LINES=4:GOSUB 220:POKE 752,0:?
500 TRAP 830:RLINE=510:POKE 764,255:INPUT A
510 LINES=2:GOSUB 220:POKE 752,0:?
520 TRAP 830:RLINE=530:POKE 764,255:INPUT B
530 LINES=2:GOSUB 220:POKE 752,0:?
540 TRAP 830:RLINE=550:POKE 764,255:INPUT C
550 S=40*A+45*B+36*C:Q=S/60:Z=(Q-INT(Q))*60:N=INT(Z+0.05)
560 TRAP 40000:GOSUB 920
570 REM
580 REM FOURTH ALGORITHM
590 REM
600 LINES=11:GOSUB 220:FINAL=1
610 INPUT R$:N=1089:? CHR$(125):? :GOSUB 920
620 REM
630 REM FIFTH ALGORITHM
640 REM
650 LINES=6:GOSUB 220
660 POKE 764,255:INPUT R$:N=18:? :DONE=1:GOSUB 920
670 REM
680 REM END OF PROGRAM
690 REM
700 GRAPHICS 0:POKE 764,255:? :? "BASIC":? "IS";:END
710 REM
720 REM SUBROUTINES
730 REM
740 FOR DING=8 TO 0 STEP -2:SOUND 0,0,2,DING:NEXT DING:RETURN
750 FOR BONG=4 TO 0 STEP -0.1:SOUND 0,102,12,BONG:NEXT BONG:RETURN
760 POKE 540,JIFFY
770 IF PEEK(540) THEN 770
780 RETURN
790 GRAPHICS 0:C=INT(RND(0)*16)
800 SETCOLOR 2,C,2:SETCOLOR 4,C,2:SETCOLOR 1,C,12
810 RETURN
820 ? :LINE$="ENTER THE RESULT THEN PRESS RETURN":GOSUB 170:GOTO 850
830 ? :LINE$="I DON'T UNDERSTAND THAT":GOSUB 170:GOSUB 750:IF RLINE THEN GOTO RLINE
840 GOTO 820
850 POKE 752,0:? :TRAP 830:POKE 764,255:INPUT RESULT:RETURN
860 POKE 752,1:? :? " PRESS START TO CONTINUE";:GOSUB 740
870 IF PEEK(53279)<>6 THEN 870
880 IF PEEK(53279)=6 THEN 880
890 IF DONE THEN RETURN
900 GOSUB 790:GOSUB 910:RETURN
910 Y=-1:LINE$="Select a positive whole number.":GOSUB 170:GOSUB 740:RETURN
920 POKE 752,1:IF FINAL THEN 940
930 ? :? " YOUR ORIGINAL NUMBER IS ";N:GOSUB 860:RETURN
940 ? :? " YOUR FINAL RESULT IS ";N:GOSUB 860:RETURN
950 REM
960 REM DISPLAY DATA
970 REM
980 DATA ARITHMETRIX by Jerry White
990 DATA This program will demonstrate five
1000 DATA simple number tricks. In each case
1010 DATA you will choose a positive whole
1020 DATA number and write it down.
1030 DATA The program will ask you to make
1040 DATA calculations and enter results.
1050 DATA ARITHMETRIX will then give you the
1060 DATA value of your original number or
1070 DATA the results of your calculations.
1080 DATA Multiply (your number+1)
1090 DATA by (your number-1).
1100 DATA Multiply your number by 3 then
1110 DATA tell me if the result is Odd or Even.
1120 DATA Add 1 to the result then divide by 2.
1130 DATA Divide the new result by 2@
1140 DATA multiply by 3@ subtract 6@
1150 DATA then divide by 9.
1160 DATA Disregard any remainder.
1170 DATA This time your number must be
1180 DATA less than 60.
1190 DATA Divide your original number by 3 then
1200 DATA enter the remainder.
1210 DATA Divide your original number by 4 then
1220 DATA enter the remainder.
1230 DATA Divide your original number by 5 then
1240 DATA enter the remainder.
1250 DATA This time you must use a three digit
1260 DATA number. The difference between the
1270 DATA first and last digit must be greater
1280 DATA than 1. Reverse the order of your
1290 DATA number and label it RESULT1.
1300 DATA Find the difference between your
1310 DATA original number and RESULT1@ and
1320 DATA label it RESULT2. Reverse the digits
1330 DATA of RESULT2@ and label it RESULT3.
1340 DATA Add RESULT2 to RESULT3
1350 DATA then press the RETURN key.
1360 DATA Multiply your number by 6 then add 36.
1370 DATA Divide the result by 2@ and label it
1380 DATA RESULT1. Multiply your original
1390 DATA number by 3@ and label it RESULT2.
1400 DATA Subtract RESULT2 from RESULT1
1410 DATA then press the RETURN key
