Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0134/xmisc.fcl
There is 1 other file named xmisc.fcl in the archive. Click here to see a list.
10.10 T!"HERE ARE SEVERAL SMALL FOCAL PROGRAMS, SET ONE TO A GROUP."
10.20 T!"THE FIRST LINE OF EACH GROUP DESCRIBES THE GROUP'S FUNCTION:"!
10.30 W 11.01,12.01,13.01,14.01,15.01,16.01,17.01,18.01,19.01,20.01,21.01,22.01,23.01,24.01,25.01,26.01,27.01,28.01,29.01,30.01
10.40 T!"TO RUN ONE OF THE PROGRAMS, SAY GROUP MM, TYPE 'DO MM'"!!!
10.50 QUIT
11.01 C - FOCAL EXAMPLE 1 TABLE GENERATION USING FUNCTIONS
11.03 TYPE %E8.07;xecute FOCAL(2,2);C SUPPRESS "=" TYPEOUT.
11.05 T! " I SINE COSINE LOG E"!
11.07 FOR I=1,.00001,1.000101;T %7.06,I," ",FSIN(I)," ",FCOS<I>," ",%,FLOG[I]," ",FEXP(I),!
11.09 QUIT
12.01 C - FOCAL EXAMPLE 2 DECIMAL TO OCTAL CONVERSION.
12.20 S I=0,M=0;X FOCAL(1,1)+FOCAL(2,2);C SUPPRESS COLON AND EQUALS.
12.25 A "DECIMAL: "
12.30 S I=I+1,A(I)=FCHR(-1)-48;IF A(I)*(A(I)-9) 12.3,12.3
12.31 I FABS(A(I)+48-16),12.96;I A(I)+48-127 12.35,12.2,12.35
12.35 I M 12.4,12.7,12.4
12.40 I -FABS(A(I)+48-13) 12.5;X FCHR(-1);G 12.8 ;CARRIAGE-RETURN - SWALLOW LINE-FEED.
12.50 T " ";G 12.8 ;CHARACTER OTHER THAN CR
12.60 I -FABS(A(M)+48-13) 12.5;X FCHR(-1);G 12.8
12.70 F M=1,I-1;S A(M-I)=A(M)
12.75 S M=I,I=0;I A(M)+48-46 12.6,12.3,12.6
12.80 T "OCTAL:";IF FABS(M) 12.8,12.95;S K=0
12.85 S A=0,B=0;F J=-M+1,-1;S A(J)=(10*A+A(J))/8,A=8*(A(J)-FITR(A(J))),A(J)=FITR(A(J)),B=B+A(J)
12.90 S K=K+1,B(K)=A;IF -FABS(B) 12.85;F J=K,-1,1;X FCHR(48+B(J))
12.95 S I=I-1;T ".";F J=1,I*1.2;D 12.98;X FCHR(A+48)
12.96 T !;Q
12.98 S A=0;F K=I,-1,1;S A(K)=8*A(K)+A,A=FITR(A(K)/10),A(K)=A(K)-10*A
13.01 C - FOCAL EXAMPLE 3 FINDING ROOTS OF A QUADRATIC EQUATION
13.10 A!"FOR EQUATION:"!!" 2"!"AX +BX+C ENTER A ",A,"ENTER B ",B,"ENTER C ",C;S ROOT=B^2-4*A*C
13.20 IF -FABS(A) 13.4;T ! "THIS IS A FIRST DEGREE EQUATION" !; GOTO 13.10
13.40 T %6.03, ! " THE ROOTS ARE"; IF (ROOT) 13.7,13.6
13.50 T !,(-B+FSQT(ROOT))/(2*A),!,(-B-FSQT(ROOT))/(2*A); GOTO 13.1
13.60 T ! -B/(2*A),!; GOTO 13.10
13.70 T " IMAGINARY"!, -B/(2*A)," + (",FSQT(-ROOT)/(2*A),")*i"
13.80 T !,-B/(2*A)," - (",FSQT(-ROOT)/(2*A),")*i",!; GOTO 13.10
14.01 C - FOCAL EXAMPLE 4 POETRY READING.
14.02 T!"LET'S HAVE SOME POETRY!"!!;G 14.07
14.03 ASK"WHICH POEM WOULD YOU LIKE? ";S N=FCHR(-1);I-FABS(N-27)14.04;Q
14.04 S X=FCHR(-1);I-FABS((X-27)*(X-127)*(X-10)) 14.04;T!!!!!;I(127-X),14.03
14.05 IF(N-33) 14.99;S N=N-64
14.06 I FABS(N-0M),14.30;I FABS(N-0G),14.09;I FABS(N-0H),14.51;I FABS(N-0J),14.61;I FABS(N-0L),14.71;I FABS(N-0B),14.81;I FABS(N-0X),14.07;I FABS(N-0Q),14.41;I FABS(N-0P),14.21,14.03
14.07 T"THE POEMS AVAILABLE ARE..."!!
14.08 T"(X) INDEX"!,"(G) ";D 14.09;T"(M) ";D 14.30;T"(H) ";D 14.51;T"(J) ";D 14.61;T"(L) ";D 14.71;T"(B) ";D 14.81;T"(P) ";D 14.21;T"(Q) ";D 14.41;T!!;G 14.03
14.09 T"GEORGIE PORGIE PUDDING AND PIE"!
14.10 T"KISSED THE GIRLS AND MADE THEM CRY"!
14.11 T"WHEN THE BOYS CAME OUT TO PLAY"!
14.12 T"GEORGIE PORGIE RAN AWAY"!!!
14.13 G 14.03
14.21 T"LITTLE BO PEEP HAS LOST HER SHEEP"!
14.22 T"AND CAN'T TELL WHERE TO FIND THEM"!!!
14.29 G 14.03
14.30 TYPE "MARY HAD A LITTLE LAMB"!
14.31 T"ITS FLEECE WAS WHITE AS SNOW"!
14.32 T"AND EVERYWHERE THAT MARY WENT "!
14.33 T"THE LAMB WAS SURE TO GO"!!
14.34 T"SHE TOOK IT TO THE SCHOOL ONE DAY"!
14.35 T"IT WAS AGAINST THE RULE"!
14.36 T"IT MADE THE CHILDREN LAUGH AND PLAY"!
14.37 T"AND I DON'T KNOW THE REST"!!!
14.39 G 14.03
14.41 T"MARY MARY QUITE CONTRARY"!
14.42 T"HOW DOES YOUR GARDEN GROW"!
14.43 T"WITH SILVER BELLS AND COCKLE SHELLS"!
14.44 T"AND ALL LITTLE MAIDS IN A ROW"!!!!!
14.45 G 14.03
14.51 T"HUMPTY DUMPTY SAT ON A WALL"!
14.52 T"HUMPTY DUMPTY HAD A GREAT FALL"!
14.53 T"ALL THE KINGS HORSES AND ALL THE KINGS MEN"!
14.54 T"COULDN'T PUT HUMPTY TOGETHER AGAIN"!!!!
14.59 G 14.03
14.61 T"LITTLE JACK HORNER SAT IN THE CORNER"!
14.62 T"EATING HIS CHRISTMAS PIE"!
14.63 T"PUT IN HIS THUMB AND PULLED OUT A PLUM"!
14.64 T"AND SAID WHAT A GOOD BOY AM I"!!!!!
14.69 G 14.03
14.71 T"LITTLE MISS MUFFET SAT ON A TUFFET"!
14.72 T"EATING HER CURDS AND WHEY"!
14.73 T"ALONG CAME A SPIDER AND SAT DOWN BESIDE HER"!
14.74 T"AND FRIGHTENED MISS MUFFET AWAY"!!!!!
14.79 G 14.03
14.81 T"BAA BAA BLACK SHEEP"!
14.82 T"HAVE YOU ANY WOOL"!
14.83 T"YES SIR YES SIR"!
14.84 T"THREE BAGS FULL"!
14.85 T"ONE FOR THE MASTER AND ONE FOR THE DAME"!
14.86 T"AND ONE FOR THE LITTLE BOY WHO LIVES DOWN THE LANE"!!!!!
14.87 G 14.03
14.99 QUIT
15.01 C - FOCAL EXAMPLE 5 INTEREST PAYMENT PROGRAM
15.10 ASK !!"ENTER INTEREST IN PERCENT " J,!
15.14 SET J=J/100
15.16 ASK "ENTER AMOUNT OF LOAN " A,!
15.20 ASK "NUMBER OF YEARS " N,!
15.24 ASK "NUMBER OF PAYMENTS PER YEAR " M,!!
15.30 SET N=N*M; SET I=J/M
15.34 SET B=1+I
15.40 SET R=A*I/(1-1/B^N)
15.42 TYPE "MONTHLY PAYMENT ",%7.02, R,!
15.48 TYPE "TOTAL INTEREST " R*N-A,"(APPROX.)"!!
15.55 SET B=A
15.60 TYPE " INTEREST APP TO PRINC BALANCE",!
15.62 SET L=B*I; SET P=R-L
15.66 SET B=B-P
15.68 TYPE L, " "P," "B,!
15.70 IF (B-R) 15.74,15.74,15.62
15.74 TYPE B*I," "R-B*I,! "LAST PAYMENT!" B*I+B,!
15.80 QUIT
16.01 C - FOCAL EXAMPLE 6 TEMPERATURE CONVERSION
16.10 ASK !,"FROM ",START," TO ",END," DEGREES FAHRENHEIT",!
16.20 ASK " IN INCREMENTS OF ",INCR," DEGREES",!!
16.30 TYPE "THE APPROXIMATE FAHRENHEIT TO CENTIGRADE CONVERSIONS ARE:"
16.40 FOR T=START,INCR,END; TYPE !; DO 16.50
16.45 QUIT
16.50 TYPE " ",T," FAHRENHEIT DEG. ",(T-32)*5/9," CENTIGRADE DEG."
17.01 C - FOCAL EXAMPLE 7 ONE-LINE FUNCTION PLOTTING
17.50 F I=0,.5,15; T "*",!; F J=0,30+15*FSIN(I)*FEXP[-.1*I]; T " "
18.01 C - FOCAL EXAMPLE 8 U.S. TO AUST DOLLAR CONVERSION
18.05 S RATE=.915
18.09 T %8.02;X FOCAL(2,2)
18.10 F P=1,100;D 18.31,18.32
18.20 X FCHR(12);Q
18.31 X FCHR(12);T" ";F X=1,3;T" $US $AUS"
18.32 T!!;F L=1,50;D 18.4;T!
18.40 T" ";F X=1,3;S U=L*10+(X-1)*500+(P-1)*1500;T" ",U,U*RATE
19.01 C - FOCAL EXAMPLE 9 FHIBER DEMONSTRATION
19.02 TYPE!"THIS PROGRAM IS TUNED FOR USE ON A TERMINAL SPEED OF AT LEAST 150 BAUD"!!
19.04 SET MISTAKES=0,DELAY=0;X FOCAL(1,1),FOCAL(2,2),FHIBER(1)
19.05 T%3!"WHAT IS YOUR NAME? ";IF FHIBER(4000+2^21),19.05;A N$;G 19.1
19.07 T"TOO SMALL"
19.08 S MIS=MIS+1,DEL=DEL+5000;T!"YOU HAVE MADE",MIS," MISTAKE";I MIS-1,19.09;T"S"
19.09 T!"COME ON THERE ",N$!;S DEL=DEL+2000
19.10 T"WHAT IS 2+2 ? ";X FHIBER(1);IF FHIBER(DEL+5000+2^21),19.09;S DEL=0;A X;I X-4 19.07,19.7;T"TOO BIG";G 19.08
19.70 T"CONGRATULATIONS."!;Q
20.01 C - FOCAL EXAMPLE 10 EXPRESSION EVALUATOR.
20.02 TYPE!"ENTER YOUR EXPRESSION DELIMITED BY A SPACE:"!
20.10 A X$;O O FOO.FCL;T "T ",X$,"!"!;O O TTY:;L C FOO;G 20.1
21.01 C - FOCAL EXAMPLE 11 BATCH JOB MONITOR.
21.02 C - PROGRAM TO RING BELLS WHEN OTHER JOB SAME PPN LOGS OFF.
21.05 X FOCAL(2,2)
21.10 S ME=GETTAB(2,-1),MINE=GETTAB(8,-1),ERR=FOCAL(34),NUM=0
21.20 F JOB=1,GETTAB(10,16);I-FABS(ME-GETTAB(2,JOB))-FABS(ERR-FOCAL(34))21.99;I FABS(MINE-GETTAB(8,JOB)),21.99;S NUM=NUM+1,JB1=JB,JB=JOB;I NUM-1,21.99;S JB=JB1;T%2,JOB","
21.30 I 1-NUM 21.4,21.45
21.35 T!"THERE ARE NO OTHER JOBS WITH";G 21.44
21.40 T JB1" ARE JOB NUMBERS UNDER"
21.44 T" THIS PPN."!"PLEASE SELECT THE JOB NUMBER TO WATCH ";A JB
21.45 T!"WAITING FOR JOB",%3,JB," .....";G 21.5
21.48 I FHIBER(9999+2^21),21.5;I FABS(FCHR(-1)-16),21.99;T"[CONTROL-P TO ESCAPE]"!
21.50 I FABS(ME-GETTAB(2,JB)),21.48;T!"FINISHED."!
21.90 T"";X FHIBER(500);T"";I FHIBER(3000+2^21),21.9;I FABS(FCHR(-1)-16),21.99;T"[CONTROL-P TO ESCAPE]"!;G 21.9
21.99 R