10 PRINT "PROGRAM FILE 58: ARRAY ASSIGNMENT WITH OPTION BASE 1."
20 PRINT "    ANSI STANDARD 6.2, 6.4, 9.2, 9.4, 15.2, 15.4"
30 PRINT
45 GOTO 60
50 OPTION BASE 1
60 PRINT
100 PRINT "SECTION 58.1: ONE-DIMENSIONAL ARRAYS WITHOUT THE"
105 PRINT "        DIM-STATEMENT."
110 PRINT
120 PRINT "                               BEGIN TEST."
130 PRINT
140 FOR I=1 TO 10
150 LET A(I)=I
160 NEXT I
170 LET A1=0
180 LET C=0
190 FOR I=10 TO 1 STEP -1
200 LET Y=A(I)
210 LET A1=A1+Y
220 IF Y<>I THEN 240
230 LET C=C+1
240 NEXT I
250 IF C<>10 THEN 270
260 IF A1=55 THEN 290
270 PRINT "***  TEST FAILED  ***"
280 GOTO 300
290 PRINT "***  TEST PASSED  ***"
300 PRINT
310 PRINT "                                END TEST."
320 PRINT
330 PRINT "SECTION 58.2: TWO-DIMENSIONAL ARRAYS WITHOUT THE "
335 PRINT "        DIM-STATEMENT."
340 PRINT
350 PRINT "                               BEGIN TEST."
360 PRINT
370 FOR I=1 TO 10
380 FOR J=1 TO 10
390 LET Z=I+J
400 LET B(I,J)=Z
410 NEXT J
420 NEXT I
430 LET B1=0
440 LET C=0
450 FOR I=10 TO 1 STEP -1
460 FOR J=10 TO 1 STEP -1
470 LET W=B(I,J)
480 LET B1=B1+W
490 LET Z=I+J
500 IF W<>Z THEN 520
510 LET C=C+1
520 NEXT J
530 NEXT I
540 IF C<>100 THEN 560
550 IF B1=1100 THEN 580
560 PRINT "***  TEST FAILED  ***"
570 GOTO 590
580 PRINT "***  TEST PASSED  ***"
590 PRINT
600 PRINT "                                END TEST."
610 PRINT
650 PRINT "SECTION 58.3: ONE-DIMENSIONAL ARRAYS WITH THE"
655 PRINT "        DIM-STATEMENT."
660 PRINT
670 PRINT "                               BEGIN TEST."
680 PRINT
690 DIM E(1)
700 LET E(1)=6
710 LET T9=E(1)
720 IF 6<>T9 THEN 890
730 DIM D(20)
740 FOR I=1 TO 20
750 LET H=I+1
760 LET D(I)=H
770 NEXT I
780 LET D1=0
790 LET C=0
800 FOR I=1 TO 20
810 LET M=D(I)
820 LET D1=D1+M
830 LET H=I+1
840 IF M<>H THEN 860
850 LET C=C+1
860 NEXT I
870 IF C<>20 THEN 890
880 IF D1=230 THEN 910
890 PRINT "***  TEST FAILED  ***"
900 GOTO 920
910 PRINT "***  TEST PASSED  ***"
920 PRINT
930 PRINT "                                END TEST."
940 PRINT
950 PRINT
960 PRINT "SECTION 58.4: TWO-DIMENSIONAL ARRAYS WITH THE"
965 PRINT "        DIM-STATEMENT."
970 PRINT
980 PRINT "                               BEGIN TEST."
990 PRINT
1000 DIM N(20,2),P(2,20),R(20,20)
1010 FOR I=1 TO 20
1020 LET I1=I+1
1030 LET N(I,1)=I1
1040 LET N(I,2)=-I
1050 FOR J=2 TO 1 STEP -1
1060 LET J1=I*J
1070 LET P(J,I)=J1
1080 NEXT J
1090 NEXT I
1100 FOR K=1 TO 20
1110 FOR L=1 TO 20
1120 LET K1=K+L
1130 LET R(K,L)=K1
1140 NEXT L
1150 NEXT K
1160 LET N1=0
1170 LET P1=0
1180 LET R1=0
1190 LET C=0
1200 LET T=0
1210 FOR I=1 TO 20
1220 LET I1=I+1
1230 LET T8=N(I,1)
1240 LET T9=N(I,2)
1250 IF T8 <> I1 THEN 1510
1260 IF T9 <> -I THEN 1510
1270 FOR J=1 TO 2
1280 LET F1=N(I,J)
1290 LET N1=N1+F1
1300 LET G1=P(J,I)
1310 LET P1=P1+G1
1320 LET J1=I*J
1330 IF G1 <> J1 THEN 1350
1340 LET C=C+1
1350 NEXT J
1360 NEXT I
1370 IF C<>40 THEN 1510
1380 IF N1<>20 THEN 1510
1390 IF P1<>630 THEN 1510
1400 FOR K=20 TO 1 STEP -1
1410 FOR L=1 TO 20
1420 LET Q1=R(K,L)
1430 LET R1=R1+Q1
1440 LET K1=K+L
1450 IF Q1 <> K1 THEN 1470
1460 LET T=T+1
1470 NEXT L
1480 NEXT K
1490 IF T<>400 THEN 1510
1500 IF R1=8400 THEN 1530
1510 PRINT "***  TEST FAILED  ***"
1520 GOTO 1540
1530 PRINT "***  TEST PASSED  ***"
1540 PRINT
1550 PRINT "                               BEGIN TEST."
1560 PRINT
1570 PRINT
1580 PRINT "END PROGRAM 58"
1590 END
