1 " "CLEAR :DIM E(6,6),C(6):WAIT 90:ON ERROR GOTO 90:LOCK 
2 PRINT "  SIMULTANEOUS EQUATIONS":PRINT "  Copr. 1982 Tandy Corp."
5 CLS :WAIT 0:PRINT "  New Lst Edt Slv End"
6 A=ASC INKEY$ -16:IF A>0AND A<6CLS :GOTO 10*A
7 GOTO 6
10 INPUT "# Eqns? ";F
11 IF F<2OR F>7THEN 10
12 FOR A=1TO F:FOR B=1TO F:E(A-1,B-1)=0:CLS :PRINT "E(";STR$ A;",";STR$ B;
13 INPUT ")? ";E(A-1,B-1)
14 NEXT B:CLS :PRINT "C(";STR$ A;:INPUT ")? ";C(A-1)
15 NEXT A:GOTO 5
20 GOSUB 70:FOR A=1TO F:FOR B=1TO F:B$="E("+STR$ A+","+STR$ B+") =":PAUSE B$;E(A-1,B-1):GOSUB 80
21 IF PLPRINT B$;E(A-1,B-1)
22 NEXT B:B$="C("+STR$ A+") =":PAUSE B$;C(A-1):GOSUB 80:IF PLPRINT B$;C(A-1)
23 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:GOTO 35
34 GOTO 38
35 IF B<1OR B>FTHEN 33
36 CLS :PRINT "E(";STR$ A;",";STR$ B;") =";E(A-1,B-1);:INPUT " New? ";E(A-1,B-1)
37 GOTO 30
38 CLS :PRINT "C(";STR$ A;") =";C(A-1);:INPUT " New? ";C(A-1)
39 GOTO 30
40 FOR A=0TO F-2:IF E(A,A)=0THEN 60
41 FOR B=A+1TO F-1
42 E=-E(B,A)/E(A,A):E(B,A)=0:FOR D=A+1TO F-1:E(B,D)=E(B,D)+E*E(A,D):NEXT D
43 C(B)=C(B)+E*C(A):NEXT B:NEXT A:C(F-1)=C(F-1)/E(F-1,F-1)
44 FOR A=F-2TO 0STEP -1:FOR B=A+1TO F-1:C(A)=C(A)-C(B)*E(A,B):NEXT B:C(A)=C(A)/E(A,A):NEXT A
45 BEEP 1:GOSUB 70:FOR A=1TO F:CLS :B$="X("+STR$ A+")=":PAUSE B$;C(A-1):GOSUB 80
46 IF PLPRINT B$;C(A-1)
47 NEXT A:GOTO 5
50 UNLOCK :END
60 FOR B=A+1TO F-1:IF A(B,A)=0NEXT B:WAIT :PRINT "UNSOLVABLE":GOTO 5
61 FOR C=0TO F-1:G=A(A,C):A(A,C)=A(B,C):A:B,C)=G:NEXT C
62 G=C(A):C(A)=C(B):C(B)=G:GOTO 41
70 P=0:INPUT "Hard copy? (Y/N) ";P$:IF P$="Y"LET P=1:RETURN 
71 IF P$="N"RETURN 
72 GOTO 70
80 IF INKEY$ <>""THEN 80
81 RETURN 
90 IF STATUS 4=43AND PEEK &789B=38WAIT :PRINT "UNSOLVABLE":GOTO 5
91 WAIT :PRINT "ERROR";PEEK &789B:GOTO 5
99 END
