forked from jdersch/PDP-8
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathham.fc
47 lines (39 loc) · 1.47 KB
/
ham.fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
01.10 S P=95;S S=2800;S H=3000;S E= 200;S Y=3;S A=1000;S I=5;S Q=1
02.10 S D=0
02.20 D 6;T !!!"LAST YEAR"!D," STARVED,
02.25 T !I," ARRIVED,";S P=P+I;I (-Q)2.3
02.27 S P=FITR(P/2);T !"**PLAGUE**"!
02.30 T !"POPULATION IS"P,!!"THE CITY OWNS
02.35 T A," ACRES."!!;I (H-1)2.5;T "WE HARVESTED
02.40 D 3.2
02.50 T !" RATS ATE "E," BUSHELS, YOU NOW HAVE
02.60 T !S," BUSHELS IN STORE."!
03.10 D 6; D 8;S Y=C+17;T "LAND IS TRADING AT
03.20 T Y," BUSHELS PER ACRE;";S C=1
03.30 D 4.3;A " BUY?"!Q;I (Q)7.2,3.8
03.40 I (Y*Q-S)3.9,3.6;D 4.6;G 3.3
03.50 D 4.5;G 3.3
03.60 D 3.9:G 4.8
03.70 S A=A+Q;S S=Y*Q;S C=0
03.80 A !"TO SELL?"!Q;I (Q)7.2,3.9;S Q=-Q;I (A+Q)3.5
03.90 S A=A+Q;S S=S-Y*Q;S C=0
04.10 T !"BUSHELS TO USE
04.11 A " AS FOOD?"!Q;I (Q)7.7;I (Q-S)4.2,4.7;D 4.6;G 4.1
04.20 S S=S-Q;S C=1
04.30 A !"HOW MANY ACRES OF LAND DO YOU WISH TO
04.35 A !"PLANT WITH SEED? "D
04.40 I (D)7.2;I (A-D)4.45;I (FITR(D/2)-S-1)4.65;D 4.6;G 4.3
04.45 D 4.5;G 4.3
04.50 D 7;T A," ACRES."!
04.60 D 7;D 2.6
04.65 I (D-10*P-1)5.1;D 7;T P," PEOPLE."!;G 4.3
04.70 D 4.2
04.80 D 6;T "YOU HAVE NO GRAIN LEFT AS SEED !!"!S D=0
05.10 S S=S-FITR(D/2);D 8;S Y=C;S H=D*Y
05.20 D 8;S E=0;I (FITR(C/2)-C/2)5.3;S E=S/C
05.30 S S=S-E+H;D 8;S I=FITR(C*(20*A+S)/P/100+1);S C=FITR(Q/20)
05.40 S Q=FITR(10*FABS(FRAN()));I (P-C)2.1;S D=P-C;S P=C;G 2.2
06.10 T !!"HAMURABI: "%5
07.10 I (C)7.2;S C=C-1;D 6;T "BUT YOU HAVE ONLY";R
07.20 D 6;T !"GOODBYE!"!!;Q
08.10 S C=FITR(5*ABS(FRAN()))+1