Trailing-Edge
-
PDP-10 Archives
-
decus_20tap4_198111
-
decus/20-0134/xham.fcl
There is 1 other file named xham.fcl in the archive. Click here to see a list.
ERASE,ALL
C-FOCAL v3C(245)-1 1001 22-JUN-74
01.10 X FOCAL(2,2),FOCAL(1,1),FCHR(29);D 8;X FCHR(31);D 8
01.20 S TONS=FITR(FRAN*4000),POP=FITR(FRAN*6000),YEAR=1792,POI=0
01.30 X FCHR(29);T!"O KING HAMURABI! LIVE FOREVER! HERE IS THE"!%4,YEA" B.C. ANNUAL REPORT."!"IN THE KINGDOM THERE ARE"!%5,POP," PEOPLE (ORIGINALLY"POP")"!TON" TONS OF GRAIN"!
01.40 T"HOW MANY TONS OF GRAIN WOULD YOU LIKE TO SOW THIS SEASON?"
01.90 G 2.2
02.10 S TON=FITR(TON+.5);X FCHR(29);D 8;T%4,!!YEA!!%5,POP!TON!
02.20 S TON=FITR(TON+.5);T!;X FCHR(30);D 8;A SOW;S SOW=FITR(SOW+.5)
02.21 IF(YEA-1751) 9.9;IF(TONS-SOW)3.8,3.7
02.22 I(YEA-1792) 4.1;X FCHR(31)
03.20 G 4.1
03.70 T!!!!;X FCHR(31);T"YOU WISH TO SOW EVERY BIT OF GRAIN IN THE KINGDOM!!"!"NEVERTHELESS, YOUR MAJESTY,! YOUR WISH IS MY COMMAND!"!;X FCHR(14),FCHR(42),FCHR(32);G 2.22
03.80 T!!!!;X FCHR(31);T"WITH EVERY RESPECT YOUR MAJESTY, WE HAVE ONLY"TONS" TONS OF GRAIN"!"AND WE ARE THEREFORE UNABLE TO SOW"SOW" TONS WITHOUT EXTERNAL HELP"!"WHAT IS YOUR ADVICE O KING?"!;G 2.1
04.10 S YEAR=YEAR-1
04.20 S STO=TON-SOW
04.30 S RAT=FITR(STO*FRAN(-1)*STO/POP);IF(.95-FRAN) 4.31;S RAT=0
04.31 S FLOODS=FSQT(FRAN)-.5;IF(.95-FRAN)4.32;S FLOODS=0
04.32 S DROUGHT=FSQT(FRAN)-.5;IF(.95-FRAN)4.33;S DROUGHT=0
04.33 I(RAT-STO) 4.34;S RAT=FITR(STO*3/4)
04.34 S KIL=0;I(RAT)4.4;I(POI)4.4;I(RAT-100*POI)4.35;S POI=0,RAT=RAT-100*POI,KIL=10000*POI;G 4.4
04.35 S POI=POI-RAT/100,KIL=100*RAT,RAT=0
04.40 S HARVEST=FITR(SOW*2.1*FRAN*(1-FLO)*(1-DRO))
04.60 S ENEMYDEATHS=FITR(.5+(FRAN-.9)*SOW*(1+POP*POP/10000)^.1);IF(-ENE) 4.61;S ENE=0
04.61 S EAT=FITR(POP*.1);I(EAT+RAT-STO)4.62;S EAT=FITR((STO-RAT)*.9)
04.62 CONT
04.65 S BIRTH=FITR(.5+POP*.01*(1+FRAN))
04.66 S DEATH=FITR(.5+POP*.003*(1+FRAN))
04.70 S STA=FITR(.5+POP-EAT*20);IF(-STA) 4.9;S STA=0
04.90 S TON=STO-RAT+HAR-EAT
04.91 S OVERFLOWFROMSTORAGEBINS=0;I(TON-9999)4.92;S OVE=TON-9999,TON=9999
04.92 CONTINUE
04.95 S POP=POP+BIR-DEA-ENE-STA;I(-POP)4.96;X FCHR(31);T!!!!"ALL THE PEOPLE ARE DEAD";G 9.9
04.96 C
05.01 I(YEA-1791)5.15
05.02 T BIR" BAB";D 12.3;T" BORN DURING THE YEAR "!
05.03 T DEA" DEATH";S X=DEA;D 12.01;T" OCCURRED FROM NATURAL CAUSES "!
05.04 T EAT" TON";S X=EAT;D 12.01;T" OF GRAIN W";D 12.1;T" SOLD AS FOOD "!
05.10 T HAR" TON";S X=HAR;D 12.01;T" OF GRAIN W";D 12.1;T" HARVESTED THIS YEAR "!;S REMEMBER=(DEA-1)*(EAT-1)*(BIR-1)*(HAR-1)
05.11 G 5.2
05.15 IF FABS(REM) 11.99,5.02;IF FABS((BIR-1)*(DEA-1)*(EAT-1)*(HAR-1)) 11.99,5.02;T BIR!DEA!EAT!HAR!;X FCHR(31)
05.20 I(RAT-.5)5.23;T RAT" TON";S X=RAT;D 12.01;T" OF GRAIN W";D 12.1;T" EATEN BY RATS THIS YEAR"!
05.21 I(-POI)5.23;I(FRAN-.8)5.23;T"WOULD YOU LIKE TO PURCHASE SOME RAT POISON?"!"THE PRICE IS CURRENTLY 10 TONS OF GRAIN PER BIN OF POISON. ? ";S X=FCHR(-1);A X1;X FCHR(26);D 8;X FCHR(26);D 8;I(-FABS(X-89))5.23;T"HOW MANY BINS OF POISON? ";X FCHR(30);D 8;A POI;I(10*POI-TON)5.22;S POI=FITR(TON/10)
05.22 S POI=FITR(POI+.5),TON=TON-10*POI;T POI" BIN";S X=POI;D 12.01;T" OF POISON PURCHASED. EACH BIN WILL KILL 10,000 RATS "!
05.23 X FCHR(31);D 8;I(KIL-.5)5.3;T KIL" RAT";S X=KIL;D 12.01;T" DIED FROM POISONING"!
05.30 IF(STA-.5)5.4;IF(POP) 9.1,9.1;T STA;D 12.2;T" DIED OF STARVATION"!
05.31 I(FRAN-.95)5.4;T"THE AIM OF THE GAME IS TO BUILD UP THE POPULATION!"!
05.40 CONTINUE
05.50 I(ENE-.5)5.6;T ENE" FARMER";S X=ENE;D 12.01;T" W";D 12.1;T" KILLED BY ENEMY RAIDERS"!
05.51 I(FRAN-.9)5.6;I(FRAN-.75)5.52;T"PERHAPS YOU ARE SENDING TOO MANY FARMERS TO THE FIELDS?"!;G 5.6
05.52 T"THE MORE WE SOW, YOUR MAJESTY, THE MORE THE ENEMY WILL RAID US"!
05.60 I(FLO-.005)5.7;T 100*FLO" PERCENT OF THE HARVEST WAS RUINED BY FLOODS"!
05.70 I(DRO-.005)5.8;T 100*DRO" PERCENT OF THE HARVEST WAS RUINED BY DROUGHT"!
05.80 I(OVE-.5)5.9;T OVE" TON";S X=OVE;D 12.01;T" OF WHEAT HAD TO BE THROWN IN THE SEA BECAUSE"!" WE RAN OUT OF STORAGE BINS"!
05.90 I(-TON) 2.1;T!!"ALL THE FOOD IS USED UP !!!"
08.01 X FCHR(127),FCHR(127),FCHR(127)
09.01 X FOCAL(2,2);TYPE %2
09.10 T!!"O KING! ALL THE PEOPLE HAVE DIED OF STARVATION!"!!!;QUIT
09.90 T!!!!;X FCHR(31);T"WELL DONE HAMURABI!"!;QUIT
11.02 S X=X*2^(-36);IF(-X)11.04,11.99;S X=X+1
11.04 F XC=1,6;X FCHR(32+FITR(X*64));S X=X*64-FITR(X*64)
11.99 RETURN
12.01 IF FABS(X-1) 11.99,11.99;T"S"
12.10 IF FABS(X-1) 11.99,12.11;T"ERE"
12.11 T"AS"
12.20 IF FABS(STA-1) 11.99,12.21;T" PEOPLE"
12.21 T" PERSON"
12.30 IF FABS(BIR-1) 11.99,12.31;T"IES WERE"
12.31 T"Y WAS"
TYPE "THIS PROGRAM IS INTENDED ONLY FOR VT05 TERMINAL!"!!
TYPE "TYPE 'GO' TO COMMENCE"!