1 " "LOCK :WAIT 90:PRINT "    GAUSSIAN REDUCTION":PRINT "  Copr. 1982 Tandy Corp.":CLEAR :DIM A(9,9)
5 WAIT 0:CLS :PRINT "  New Lst Edt Rdc End"
6 A=ASC INKEY$ -16:IF A>0AND A<6THEN 10*A
7 GOTO 6
10 INPUT "Array size? ";F
11 IF F>10OR F<2THEN 10
12 FOR A=1TO F:FOR B=1TO F:CLS :A(A-1,B-1)=0:PRINT "X(";STR$ A;",";STR$ B;:INPUT ")? ";A(A-1,B-1)
13 NEXT B:NEXT A:GOTO 5
20 P=0:INPUT "Hard copy? (Y/N) ";P$:IF P$="Y"LET P=1:GOTO 22
21 IF P$<>"N"THEN 20
22 FOR A=1TO F:FOR B=1TO F:B$="X("+STR$ A+","+STR$ B+") =":PAUSE B$;A(A-1,B-1)
23 IF INKEY$ <>""THEN 22
24 IF PLPRINT B$;A(A-1,B-1)
25 NEXT B:NEXT A:GOTO 5
30 CLS :INPUT "Row? ";A:GOTO 32
31 GOTO 5
32 IF A<1OR A>FTHEN 30
33 INPUT "Column? ";B
34 IF B<1OR B>FTHEN 33
35 CLS :PRINT "X(";STR$ A;",";STR$ B;") =";A(A-1,B-1);:INPUT " New? ";A(A-1,B-1)
36 GOTO 30
40 CLS :H=1:FOR A=1TO F-1:IF A(A-1,A-1)=0THEN 60
41 FOR B=A+1TO F:E=-A(B-1,A-1)/A(A-1,A-1):A(B-1,A-1)=0
42 FOR D=A+1TO F:A(B-1,D-1)=A(B-1,D-1)+E*A(A-1,D-1):NEXT D:NEXT B:NEXT A
43 G=H*A(0,0):FOR A=2TO F:G=G*A(A-1,A-1):NEXT A
44 BEEP 1:WAIT :PRINT "Det =";G:GOTO 5
50 UNLOCK :END
60 FOR B=A+1TO F:IF A(A-1,B-1)=0NEXT B:WAIT :PRINT "NO SOLUTION":A=F:NEXT A:GOTO 5
61 H=-H:FOR C=1TO F:D=A(A-1,C-1):A(A-1,C-1)=A(B-1,C-1):A(B-1,C-1)=D:NEXT C:GOTO 41
99 END
