Trailing-Edge
-
PDP-10 Archives
-
decuslib10-06
-
43,50375/read.bas
There is 1 other file named read.bas in the archive. Click here to see a list.
00010 REM READ NADDOR & SAPSFORD
00015 S$="10-NOV-75"
00016 T0=5.8
00020 PRINT S$" VERSION"
00025 RANDOM
00030 DIM X(6),I(6),S$(5),A$(5),Y(3)
00035 Q$=CHR$(34) 'QUOTE
00050 DEF FNR(X,Y) 'RETURNS RND: X <= RND < Y
00052 R=RND*(Y-X)
00054 IF X<>INT(X) THEN 60
00056 FNR=INT(R)+X
00058 GOTO 62
00060 FNR=(INT((R+X)*10))/10
00062 R=0
00064 FNEND
00070 DEF FND(X,Y,L,U)
00072 FND=X
00074 IF X<=0 THEN 90
00076 FOR I=1 TO X
00078 IF Y=2 THEN 84
00080 PRINT CHR$(64+FNR(1,27));
00082 GOTO 86
00084 PRINT FNR(0.1,U-L)-L;
00086 PRINT ",";
00088 NEXT I
00090 FNEND
00100 PRINT
00101 PRINT INT(100*(TIM+T0)+.5)/100"SECS"
00102 PRINT
00105 PRINT "G,S";
00110 INPUT G,S
00115 IF G=0 THEN 9999
00120 J9=2 'J9<0 => Y$, J9=0 => ERROR, J9>0 => Y(1),...,Y(J9)
00200 FOR I=1 TO 5
00205 X(I)=FNR(0.001,10)
00210 FOR J=1 TO I-1
00215 IF X(J)=X(I) THEN 205
00220 NEXT J
00225 I(I)=FNR(1,10)
00230 FOR J=1 TO I-1
00235 IF I(J)=I(I) THEN 225
00240 NEXT J
00245 S$(I)=CHR$(64+FNR(1,27))
00250 FOR J=1 TO I-1
00255 IF S$(J)=S$(I) THEN 245
00260 NEXT J
00265 A$(I)=CHR$(47+FNR(1,11))
00270 FOR J=1 TO I-1
00275 IF A$(J)=A$(I) THEN 265
00280 NEXT J
00285 NEXT I
00290 IF G<0 THEN 300
00295 I(6)=1+I(6)*SGN(4-I(6))
00300 PRINT
00600 GOSUB 900
00700 GOSUB 9000
00800 GOTO 100
00900 ON ABS(G) GOTO 1000,2000,3000,4000,5000,6000,7000,8000
01000 ON S GOTO 1100,1200,1300
01100 R2=I(1)-I(2)
01104 PRINT"10 REM PROG1 - VERSION";FNR(1,10)
01108 PRINT"20 LET "S$(1)" ="I(1)
01112 PRINT"30 LET "S$(2)" = "R2;" *"I(2)
01116 PRINT"40 LET "S$(3)" = "S$(1)" - "S$(2)
01120 PRINT"50 "S$(4)" = "S$(2)" + "S$(1)
01124 IF RND>0.3 THEN 1160
01128 J9=0
01132 IF RND>0.3 THEN 1144
01136 PRINT"60 RPINT "S$(3)";"S$(4)
01140 GOTO 1164
01144 IF RND>0.5 THEN 1152
01148 PRINT"60 END"
01152 PRINT"70 PRINT "S$(3)";"S$(4)
01156 GOTO 1176
01160 PRINT"60 PRINT "S$(3)";"S$(4)
01164 PRINT"70 END"
01168 Y(1)=I(1)-R2*I(2)
01172 Y(2)=I(1)+R2*I(2)
01176 RETURN
01200 X(2)=I(1)+I(2)+1
01202 GOSUB 1292
01204 S$(3)=CHR$(34)+S$(1)+CHR$(34)
01206 S$(4)=CHR$(34)+S$(4)+CHR$(34)
01208 S$(2)=S$(2)+"$"
01210 J9=-1
01212 GOSUB 1218
01214 PRINT"30 END"
01216 RETURN
01218 ON I(6) GOTO 1220,1238,1246,1254
01220 IF X(1)>5 THEN 1230
01222 PRINT"10 "S$(2)" = LEFT$("S$(3)","I(1);")"
01224 PRINT"20 PRINT "S$(2)
01226 Y$=LEFT$(S$(1),I(1))
01228 RETURN
01230 PRINT"10 "S$(2);"=RIGHT$("S$(3)","I(1);")"
01232 PRINT"20 PRINT "S$(2)
01234 Y$=RIGHT$(S$(1),I(1))
01236 RETURN
01238 PRINT"10 "S$(2);"=MID$("S$(3)","I(1)","I(2);")"
01240 PRINT"20 PRINT "S$(2)
01242 Y$=MID$(S$(1),I(1),I(2))
01244 RETURN
01246 PRINT"10 "S$(2);"=MID$("S$(3)","I(1);")"
01248 PRINT"20 PRINT "S$(2)
01250 Y$=MID$(S$(1),I(1))
01252 RETURN
01254 IF X(1)>3 THEN 1268
01256 S$(4)=MID$(S$(1),I(1)+FNR(0,3),FNR(1,I(2)))
01258 PRINT"10 "S$(5)" = INSTR("I(1)","S$(3)",";
01260 PRINT CHR$(34)+S$(4)+CHR$(34)+")"
01262 PRINT"20 PRINT "S$(5)
01264 Y$=STR$(INSTR(I(1),S$(1),S$(4)))
01266 RETURN
01268 S$(1)=""
01270 S$(4)=MID$(S$(4),2,1)
01272 GOSUB 1290
01274 GOSUB 1288
01276 I(1)=LEN(S$(1))
01278 GOSUB 1290
01280 GOSUB 1288
01282 GOSUB 1288
01284 S$(3)=CHR$(34)+S$(1)+CHR$(34)
01286 GOTO 1258
01288 S$(1)=S$(1)+S$(4)
01290 X(2)=FNR(1,4)
01292 FOR I=1 TO X(2)
01294 S$(1)=S$(1)+CHR$(64+FNR(1,27))
01296 NEXT I
01298 RETURN
01300 ON I(6) GOTO 1302,1324,1330,1346
01302 I(1)=I(1)*SGN(I(1)-5.5)
01304 PRINT"10 DEF FNF(X,Y) = INT(SGN(X)*Y)"
01306 PRINT"20 "S$(1)+A$(1)" ="I(1)
01308 PRINT"30 "S$(1)+A$(2)" ="I(2)
01310 PRINT"40 "S$(1)+A$(3)" = FNF";
01312 PRINT "( "S$(1)+A$(1)" , "S$(1)+A$(2);")"
01314 PRINT"50 PRINT "S$(1)+A$(3)
01316 PRINT"60 END"
01318 J9=1
01320 Y(1)=INT(SGN(I(1))*I(2))
01322 RETURN
01324 J9=0
01326 PRINT"10 FNZ(X) = -ABS(X)"
01328 GOTO 1336
01330 Y(1)=X(1)=-X(1)
01332 Y(2)=-ABS(X(2)-I(1))
01334 PRINT"10 DEF FNZ(X) = -ABS(X)"
01336 PRINT"20 "S$(1)" = FNZ(";X(1);")"
01338 PRINT"30 "S$(2)" = FNZ(";X(2)-I(1);")"
01340 PRINT"40 PRINT "S$(1)";"S$(2)
01342 PRINT"50 END"
01344 RETURN
01346 S$(1)="FN"+S$(1)
01348 PRINT"10 DEF "S$(1);"(X,Y,Z)"
01350 PRINT"20 IF X>5 THEN 50"
01352 PRINT"30 "S$(1)" = Y"
01354 PRINT"40 GOTO 60"
01356 PRINT"50 "S$(1)" = Z-X"
01358 IF I(1)>2 THEN 1364
01360 J9=0
01362 GOTO 1366
01364 PRINT"60 FNEND"
01366 PRINT"100 "S$(2)" ="I(1)
01368 PRINT"110 "S$(3)" = "S$(1);"( "S$(2)",";X(1)",";X(2);")"
01370 PRINT "120 PRINT "S$(3)";"S$(1)"("STR$(11-I(1))",";
01372 PRINT X(3);","X(4);")"
01374 PRINT"130 END"
01376 ON (SGN(I(1)-5.5)*J9/2)+2 GOTO 1378,1382,1384
01378 Y(1)=X(1)
01380 Y(2)=X(4)+I(1)-11
01382 RETURN
01384 Y(1)=X(2)-I(1)
01386 Y(2)=X(3)
01388 RETURN
02000 GOSUB 2020
02005 IF S=3 THEN 2015
02010 PRINT"999 END"
02015 RETURN
02020 ON S GOTO 2100,2200,2300
02100 FOR I=1 TO 5
02102 A$(I)="("+A$(I)+")"
02104 IF I(6)<3 THEN 2108
02106 A$(I)="$"+A$(I)
02108 NEXT I
02110 PRINT"10 DATA ";
02112 I(1)=FNR(1,4)
02114 IF I(6)<3 THEN 2126
02116 I(1)=FND(I(1),1,0,0)
02118 Y$=CHR$(64+FNR(1,27))+CHR$(64+FNR(1,27))
02120 J9=-1
02122 PRINT LEFT$(Y$,1)
02124 GOTO 2130
02126 I(1)=FND(I(1),2,-50,50)
02128 PRINT X(1)
02130 PRINT"20 READ ";
02132 FOR I=1 TO I(1)
02134 PRINT S$(I)+A$(I)+",";
02136 NEXT I
02138 PRINT S$(I(1)+1)+A$(I(1)+1)+","+S$(I(1)+2)+A$(I(1)+2)
02140 PRINT"30 DATA ";
02142 IF I(6)<3 THEN 2152
02144 PRINT RIGHT$(Y$,1)",";
02146 I(2)=FND(INT(I(2)/2)+1,1,0,0)
02148 PRINT CHR$(64+FNR(1,27))
02150 GOTO 2162
02152 PRINT X(2)",";
02154 I(2)=FND(INT(I(2)/2)+1,2,-50,50)
02156 PRINT X(3)
02158 Y(1)=X(1)
02160 Y(2)=X(2)
02162 PRINT"40 PRINT "S$(I(1)+1)+A$(I(1)+1)+";"+S$(I(1)+2)+A$(I(1)+2)
02164 RETURN
02200 ON I(6) GOTO 2202,2244,2270,2270
02202 I(1)=FNR(1,6)
02204 I(2)=FNR(1,6)
02206 PRINT"10 READ ";
02208 FOR I=1 TO 4
02210 PRINT S$(I)+A$(1)+";";
02212 NEXT I
02214 PRINT S$(5)+A$(1)
02216 IF RND>0.25 THEN 2222
02218 J9=0
02220 GOTO 2228
02222 PRINT"20 RESTORE"
02224 Y(1)=X(I(1))
02226 Y(2)=X(I(2))
02228 PRINT"30 READ ";
02230 FOR I=1 TO 4
02232 PRINT S$(I)+A$(2)+";";
02234 NEXT I
02236 PRINT S$(5)+A$(2)
02238 PRINT"40 PRINT "S$(I(1))+A$(1)+";"+S$(I(2))+A$(2)
02240 PRINT"50 DATA";X(1)",";X(2)",";X(3)",";X(4)",";X(5)
02242 RETURN
02244 PRINT"20 READ "S$(1)","S$(2)+"$"
02246 PRINT"40 RESTORE";
02248 I(1)=FNR(1,4)
02250 PRINT MID$(" $*",I(1),1)
02252 PRINT"60 READ "S$(2)+"$"
02254 PRINT"80 PRINT "S$(1);";LEFT$("S$(2)+"$";",1)"
02256 PRINT"900 DATA "I(2)","S$(3)+S$(4)
02258 IF I(1)=3 THEN 2266
02260 J9=-1
02262 Y$=STR$(I(2))+" "+S$(3)
02264 RETURN
02266 J9=0
02268 RETURN
02270 J9=3-I(6)
02272 S$(2)=S$(2)+"$"
02274 IF J9=0 THEN 2278
02276 S$(1)=S$(1)+"$"
02278 PRINT"100 READ "S$(1)","S$(2)
02280 PRINT"105 PRINT "S$(1)";"S$(2)
02282 PRINT"110 DATA ";Q$+STR$(I(1))+Q$",";Q$+S$(4)+S$(5)+Q$
02284 Y$=STR$(I(1))+S$(4)+S$(5)
02286 RETURN
02300 S$=S$(1)
02302 T$=S$(2)
02304 IF I(6)=4 THEN 2342
02306 PRINT "10 INPUT ";
02308 I9=2
02310 ON I(6) GOTO 2312,2322,2332
02312 PRINT S$","T$
02314 PRINT "20 PRINT SGN("S$"-"T$");INT("S$"/"T$")"
02316 Y(1)=SGN(I(1)-I(2))
02318 Y(2)=INT(I(1)/I(2))
02320 GOTO 2352
02322 PRINT S$"$,"T$"$"
02324 PRINT "20 PRINT "S$"$+"T$"$"
02326 J9=1
02328 Y(1)=10*I(1)+I(2)
02330 GOTO 2352
02332 PRINT S$"$,"T$"$"
02334 PRINT "20 PRINT VAL("S$"$)+VAL("T$"$)"
02336 J9=1
02338 Y(1)=I(1)+I(2)
02340 GOTO 2352
02342 I9=Y(1)=3+INT(I(3)/3)
02344 R=FNR(3,I9+1)
02346 Y(2)=I(R)
02348 PRINT "10 MAT INPUT "S$
02350 PRINT "20 PRINT NUM;"S$"("R;")"
02352 PRINT "99 END"
02354 PRINT "RUNNH"
02356 PRINT "?"I(1);
02358 FOR I=2 TO I9
02360 PRINT ","I(I);
02362 NEXT I
02364 PRINT
02366 RETURN
03000 ON S GOTO 3100,3200,3300
03100 J9=1
03104 ON I(6) GOTO 3108,3140,3172,3172
03108 PRINT"10 "S$(1)" ="I(3)
03112 PRINT"20 FOR "S$(2)" ="I(1)" TO"I(1)+I(2)
03116 PRINT"30 "S$(1)" = "S$(1)" + "S$(2)
03120 PRINT"40 NEXT "S$(2)
03124 PRINT"50 PRINT "S$(1)
03128 PRINT"60 END"
03132 Y(1)=(I(2)+1)*(I(1)+(I(2)/2))+I(3)
03136 RETURN
03140 PRINT"10 "S$(1)" = ";-I(1)*(I(1)+1)/2+I(3)
03144 PRINT"20 FOR "S$(2)+A$(1)" = 1 TO"I(1)
03148 PRINT"30 "S$(1)" = "S$(1)" +"I(2);"* "S$(2)+A$(1)
03152 PRINT"40 NEXT "S$(2)+A$(1)
03156 PRINT"50 PRINT "S$(1)
03160 PRINT"60 END"
03164 Y(1)=I(1)*((I(1)+1)/2)*(I(2)-1+Y(1))+I(3)
03168 RETURN
03172 PRINT"10 "S$(1)" ="I(3)
03176 Y(1)=1
03180 GOTO 3144
03200 I(5)=I(3)*(I(2)-1)
03204 X(2)=-INT(X(2))
03208 X(1)=INT(X(1))
03212 IF RND>0.6 THEN 3224
03216 I(5)=I(1)+I(5)+FNR(0,I(3))
03220 GOTO 3236
03224 I(1)=I(4)+I(5)+FNR(0,I(3))
03228 I(5)=I(4)
03232 I(3)=-I(3)
03236 PRINT"10 "S$(1)" =";X(1)
03240 PRINT"20 "S$(2)" =";1+X(2)
03244 PRINT"30 FOR "S$(3)" ="I(1)" TO"I(5)" STEP "I(3)
03248 PRINT"40 "S$(1)" = "S$(1)" + "S$(2)
03252 PRINT"50 "S$(2)" = "S$(2)" + 2"
03256 PRINT"60 NEXT "S$(3)
03260 PRINT"70 PRINT "S$(1)";"S$(2)";"S$(3)
03264 PRINT"80 END"
03268 J9=3
03272 Y(1)=I(2)*(I(2)+X(2))+X(1)
03276 Y(2)=1+X(2)+2*I(2)
03280 Y(3)=I(1)+I(3)*(I(2)-1)
03284 RETURN
03300 I(2)=FNR(0,4)
03302 I(4)=FNR(1,4)
03304 X(1)=INT(X(1))
03306 X(3)=INT(X(3))
03308 PRINT"10 "S$(1)" =";X(1)+X(3)
03310 PRINT"20 FOR "S$(2)" ="I(1);"TO"I(1)+I(2)*I(3)+FNR(0,I(3));
03312 PRINT "STEP"I(3)
03314 IF I(6)>2 THEN 3342
03316 PRINT"30 "S$(1)" = "S$(1)" +"I(4)-1
03318 X(4)=INT(X(1)/2)
03320 X(5)=X(1)-2*(I(2)+1)
03322 IF X(5)<0 THEN 3332
03324 Y(1)=X(1)+X(3)-2*(I(2)+1)
03326 Y(2)=I(1)+I(2)*I(3)
03328 Y(3)=I(2)+I(4)*I(5)
03330 GOTO 3362
03332 Y(1)=X(3)-1
03334 Y(2)=I(1)+I(3)*X(4)
03336 IF X(1)-X(4)*2>1 THEN 3328
03338 Y(3)=I(2)+I(5)*(I(4)-1)
03340 Y(1)=X(3)-1
03342 PRINT"30 REM BEGIN INNER LOOP"
03344 IF X(1)>(I(2)+1)*(I(4)+1) THEN 3358
03346 X(4)=INT(X(1)/(I(4)+1))
03348 X(5)=INT(X(1)-X(4)*(I(4)+1))
03350 Y(1)=X(3)-1
03352 Y(2)=I(1)+I(3)*X(4)
03354 Y(3)=I(2)+I(5)*X(5)
03356 GOTO 3362
03358 Y(1)=X(1)+X(3)-(I(2)+1)*(I(4)+1)
03360 GOTO 3326
03362 PRINT"40 FOR "S$(3)" ="I(2);"TO"I(2)+I(4)*I(5)+FNR(0,I(5));
03364 PRINT "STEP"I(5)
03366 PRINT"50 "S$(1)" = "S$(1)" - 1"
03368 PRINT"60 IF "S$(1)" <";X(3);"THEN 90"
03370 IF RND>0.2 THEN 3380
03372 PRINT"70 NEXT "S$(2)
03374 PRINT"80 NEXT "S$(3)
03376 J9=0
03378 GOTO 3386
03380 PRINT"70 NEXT "S$(3)
03382 PRINT"80 NEXT "S$(2)
03384 J9=3
03386 PRINT"90 PRINT "S$(1)";"S$(2)";"S$(3)
03388 PRINT"100 END"
03390 RETURN
04000 ON S GOTO 4100,4200,4300
04100 J9=3
04102 I(5)=5-I(6)
04104 IF I(1)>2 THEN 4108
04106 I(5)=2.5+2.5*SGN(I(6)-2.5)
04108 X(1)=INT((I(6)+1)/2)
04110 Y(X(1))=I(1)
04112 Y(3-X(1))=I(2)
04114 S$(4)=S$(X(1))
04116 S$(5)=S$(3-X(1))
04118 ON I(5)+1 GOTO 4120,4124,4126,4128,4130,4120
04120 J9=0
04122 GOTO 4132
04124 Y(1)=Y(1)*Y(2)
04126 Y(2)=Y(1)+Y(2)
04128 Y(2)=Y(2)-2*Y(1)
04130 Y(3)=Y(1)+Y(2)
04132 PRINT "10 "S$(4)" ="I(1)
04134 PRINT "20 "S$(5)" ="I(2)
04136 PRINT "30 "S$(1)+A$(1)" ="I(5)
04138 PRINT"40 ON "S$(1)+A$(1)" GOTO 50,60,70,80"
04140 PRINT "50 "S$(1);"= "S$(1);"*"S$(2)
04142 PRINT "60 "S$(2);"= "S$(1);"+"S$(2)
04144 PRINT "70 "S$(2);"= "S$(2);"-2*"S$(1)
04146 PRINT "80 "S$(3);"= "S$(1);"+"S$(2)
04148 PRINT "90 PRINT "S$(1)";"S$(2)";"S$(3)
04150 PRINT "100 END"
04152 RETURN
04200 S$(1)=S$(1)+"$"
04202 S$="+-*/+-*"
04204 PRINT"100 INPUT "S$(1)
04206 PRINT"110 "S$(2)" = VAL(LEFT$("S$(1);",1)"
04208 PRINT"120 "S$(3)" = VAL(RIGHT$("S$(1);",1)"
04210 J=FNR(1,5)
04212 PRINT "130 ON INSTR("Q$;MID$(S$,J,4);Q$",MID$(";
04214 PRINT S$(1)",2,1)) GOTO 140,150,160,170"
04216 FOR I=140 TO 170 STEP 10
04218 PRINT STR$(I)+" PRINT "S$(2);MID$("+-*/",(I-130)/10,1);S$(3)
04220 IF I=170 THEN 4226
04222 PRINT STR$(I+5)+" GOTO 999"
04224 NEXT I
04226 PRINT"999 END"
04228 PRINT"RUNNH"
04230 PRINT " ?"STR$(I(3));MID$(S$,I(6),1);STR$(I(4))
04232 J9=1
04234 A=I(6)-J+1+4*SGN(1-SGN(I(6)-J+1))
04236 DEF FNS(K)=1-ABS(SGN(K-A))
04238 M=I(3)
04240 N=I(4)
04242 Y(1)=FNS(1)*(M+N)+FNS(2)*(M-N)+FNS(3)*M*N+FNS(4)*M/N
04244 RETURN
04300 S=SGN(2.5-I(6))
04302 S$=MID$("<><>",I(6),1)
04310 PRINT "10 READ "S$(1)
04312 PRINT "20 MAT READ "S$(2);"("S$(1);")"
04314 PRINT "30 "S$(3)" = "S
04316 PRINT "40 GOSUB 1000"
04318 PRINT "50 PRINT "S$(2)";"
04320 PRINT "60 "S$(3)" = ";-S
04322 PRINT "70 GOSUB 1000"
04324 PRINT "80 PRINT "S$(2)
04326 PRINT "90 GOTO 9999"
04328 PRINT "1000 "S$(2)" = "S$(2)"(1)"
04330 PRINT "1010 FOR "S$(4)" = 2 TO "S$(1)
04332 PRINT "1020 IF "S$(2)+"("+S$(4)+")*"S$(3);
04334 PRINT S$;S$(2)"*"S$(3)" THEN 1040"
04336 PRINT "1030 "S$(2);"="S$(2);"("S$(4);")"
04338 PRINT "1040 NEXT "S$(4)
04340 PRINT "1050 RETURN"
04342 PRINT "9000 DATA "STR$(I(1));
04350 M=N=I(2)
04352 FOR I=2 TO I(1)+1
04354 IF I>6 THEN 4360
04356 S=I(I)
04358 GOTO 4362
04360 S=INT(X(I-6))
04362 PRINT ","STR$(S);
04364 IF S>=M THEN 4368
04366 M=S
04368 IF S<=N THEN 4372
04370 N=S
04372 NEXT I
04374 PRINT
04380 PRINT "9999 END"
04390 I=(ABS(2*I(6)-5)+1)/2
04392 Y(I)=M
04394 Y(3-I)=N
04399 RETURN
05000 M=N=2
05005 ON I(6) GOTO 5010,5020,5025,5025
05010 N=3
05015 GOTO 5025
05020 M=3
05025 I9=M*N
05030 D$="("+STR$(M)+","+STR$(N)+")"
05035 PRINT "10 MAT READ "S$(1);D$
05040 S2$="20 MAT "+S$(3)+" = "
05045 ON S GOTO 5100,5200,5300
05100 S1$="15 MAT "+S$(2)+" = "
05102 D2$="("+STR$(N)+","+STR$(M)+")"
05104 S2$=S2$+S$(2)+" "
05106 ON I(6) GOTO 5108,5118,5128,5138
05108 S1$=S1$+"CON"
05110 S2$=S2$+"+"
05112 Y(1)=1+I(2)
05114 Y(2)=1+I(4)
05116 GOTO 5146
05118 S1$=S1$+"CON"
05120 S2$=S2$+"-"
05122 Y(1)=1-I(2)
05124 Y(2)=1-I(3)
05126 GOTO 5146
05128 S1$=S1$+"ZER"
05130 S2$=S2$+"+"
05132 Y(1)=I(2)
05134 Y(2)=I(3)
05136 GOTO 5146
05138 S1$=S1$+"IDN"
05140 S2$=S2$+"-"
05142 Y(1)=-I(2)
05144 Y(2)=-I(3)
05146 PRINT S1$;D$
05148 S2$=S2$+" "+S$(1)
05150 GOTO 5900
05200 ON I(6) GOTO 5202,5210,5218,5218
05202 S2$=S2$+"TRN("
05204 Y(1)=I(4)
05206 Y(2)=I(2)
05208 GOTO 5236
05210 S2$=S2$+"TRN("
05212 Y(1)=I(3)
05214 Y(2)=I(2)
05216 GOTO 5236
05218 S2$=S2$+"INV("
05220 D=I(1)*I(4)-I(2)*I(3)
05222 IF D=0 THEN 5234
05224 Y(1)=D
05226 Y(2)=-I(2)/D
05228 Y(3)=-I(3)/D
05230 J9=3
05232 GOTO 5236
05234 J9=0
05236 S2$=S2$+S$(1)+")"
05238 IF J9<3 THEN 5244
05240 PRINT S2$
05242 PRINT "25 PRINT DET;"
05244 GOTO 5900
05300 I9=2*I9
05302 IF I(6)>2 THEN 5322
05304 PRINT "15 MAT READ "S$(2)"("STR$(N)","STR$(M)")"
05306 S2$=S2$+S$(2)
05308 IF I(6)=2 THEN 5316
05310 Y(1)=INT(X(1))*I(2)+INT(X(2))*I(5)
05312 Y(2)=INT(X(3))*I(1)+INT(X(4))*I(4)
05314 GOTO 5330
05316 Y(1)=INT(X(1))*I(2)+INT(X(2))*I(4)+INT(X(3))*I(6)
05318 Y(2)=INT(X(4))*I(1)+INT(X(5))*I(3)+INT(X(6))*I(5)
05320 GOTO 5330
05322 PRINT "15 READ "S$(2)
05324 S2$=S2$+"("+S$(2)+")"
05326 Y(1)=I(5)*I(2)
05328 Y(2)=I(5)*I(3)
05330 S2$=S2$+" * "+S$(1)
05332 GOTO 5900
05900 IF J9=3 THEN 5910
05905 PRINT S2$
05910 PRINT "30 PRINT "S$(3)"(1,2);"S$(3)"(2,1)"
05915 PRINT "90 DATA "STR$(I(1));
05920 FOR I=2 TO I9
05925 PRINT ",";
05930 IF I>6 THEN 5945
05935 PRINT STR$(I(I));
05940 GOTO 5950
05945 PRINT STR$(INT(X(I-6)));
05950 NEXT I
05955 PRINT
05960 PRINT "99 END"
05965 RETURN
06000 GOTO 9900
07000 GOTO 9900
08000 ON S GOTO 8100,8200,8300
08100 Y(1)=I(1)+I(2)
08105 Y(2)=I(1)-I(2)
08110 S$=";"
08115 ON I(6) GOTO 8155,8120,8145,8120
08120 S$(4)=S$(4)+S$(5)
08125 IF I(6)=2 THEN 8155
08130 S$=""
08135 J9=0
08140 GOTO 8155
08145 J9=0
08150 GOTO 8160
08155 PRINT"10 BEGIN INTEGER "S$(1)","S$(2)","S$(3)","S$(4);S$
08160 PRINT "20 "S$(1)":="I(1);";"S$(2)":="I(2);";"
08165 PRINT "30 "S$(3)":="S$(1)"+"S$(2)";"S$(4)":="S$(1)"-"S$(2)";"
08170 PRINT "40 PRINT ("S$(3)");PRINT("S$(4)")"
08175 PRINT "50 END"
08180 RETURN
08200 Y(1)=I(1)+I(2)
08204 Y(2)=I(1)-I(2)
08208 S$=" "
08212 T$=S$(3)+","+S$(4)
08216 ON I(6) GOTO 8220,8224,8240,8232
08220 S$(1)=S$(1)+S$(5)
08224 T$=STR$(I(3))+","+T$
08228 GOTO 8244
08232 T$=S$(1)+"+"+S$(2)+","+S$(1)+"-"+S$(2)
08236 T$=STR$(I(3))+","+T$
08240 J9=0
08244 PRINT "5 IMPLICIT INTEGER(A-Z)"
08248 PRINT "10"S$;S$(1)"="I(1)
08252 PRINT "20"S$;S$(2)"="I(2)
08256 IF I(6)=4 THEN 8268
08260 PRINT "30"S$;S$(3)"="S$(1)"+"S$(2)
08264 PRINT "40"S$;S$(4)"="S$(1)"-"S$(2)
08268 PRINT "50"S$"TYPE "T$
08272 IF I(6)=3 THEN 8280
08276 PRINT "90 "STR$(I(3))" FORMAT(I3,I3)"
08280 PRINT "99"S$"END"
08284 RETURN
08300 A$(1)=STR$(I(1)) 'APL 8300
08302 A$(2)=STR$(I(3))
08304 A$(3)=S$(1)+"+"+S$(2)
08306 ON I(6) GOTO 8310,8320,8330,8360
08310 Y(2)=I(1)-I(3)
08312 A$(4)=S$(1)+"-"+S$(2)
08314 GOTO 8324
08320 Y(2)=I(1)*I(3)
08322 A$(4)=S$(1)+"#"+S$(2)
08324 Y(1)=I(1)+I(3)
08326 A$(5)=S$(3)+","+S$(4)
08328 GOTO 8390
08330 Y(1)=I(1)+I(2)+I(3)+I(4)
08332 M=I(1)
08334 IF M<I(3) THEN 8338
08336 M=I(3)
08338 N=I(2)
08340 IF N<I(4) THEN 8344
08342 N=I(4)
08344 Y(2)=M*N
08346 A$(4)=S$(1)+" .FL "+S$(2)
08348 A$(5)="(+/"+S$(3)+"),"+"#/"+S$(4)
08350 GOTO 8380
08360 Y(1)=(I(1)+I(3))*(I(2)+I(4))
08362 M=I(1)
08364 IF M>I(3) THEN 8368
08366 M=I(3)
08368 N=I(2)
08370 IF N>I(4) THEN 8374
08372 N=I(4)
08374 Y(2)=M+N
08376 A$(4)=S$(1)+" .CE "+S$(2)
08378 A$(5)="(#/"+S$(3)+"),"+"+/"+S$(4)
08380 A$(1)=A$(1)+" "+STR$(I(2))
08382 A$(2)=A$(2)+" "+STR$(I(4))
08390 FOR I=1 TO 5
08392 PRINT "["STR$(I)"] "S$(I)"_"A$(I)
08394 NEXT I
08396 PRINT "[6] "S$(5)
08398 RETURN
09000 IF R9=-999 THEN 9080
09005 PRINT
09010 PRINT"WHAT WILL BE PRINTED";
09015 INPUT A$ 'STUDENT ANSWER
09020 PRINT"CORRECT IS: ";
09025 ON SGN(J9)+2 GOTO 9040,9030,9055
09030 PRINT"AN ERROR MESSAGE"
09035 GOTO 9080
09040 PRINT Y$
09045 Y$=""
09050 GOTO 9080
09055 FOR J=1 TO J9
09060 PRINT Y(J);
09065 Y(J)=0
09070 NEXT J
09075 PRINT
09080 R9=0
09085 RETURN
09900 PRINT "NOT READY"
09905 R9=-999
09910 RETURN
09999 END