-
Notifications
You must be signed in to change notification settings - Fork 0
/
HAMURABI.BAS
147 lines (136 loc) · 5 KB
/
HAMURABI.BAS
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
5 PRINT CHR$(26):WIDTH 80
10 PRINT TAB(32);"HAMURABI":PRINT
20 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
30 PRINT:PRINT:PRINT
40 PRINT "TRY YOUR HAND AT GOVERNING ANCIENT SUMERIA"
50 PRINT "FOR A TEN-YEAR TERM OF OFFICE.":PRINT
60 D1=0: P1=0
70 Z=0: P=95:S=2800: H=3000: E=H-S
80 Y=3: A=H/Y: I=5: Q=1
90 D=0
100 PRINT:PRINT:PRINT "HAMURABI: I BEG TO REPORT TO YOU,": Z=Z+1
110 PRINT "IN YEAR";Z;CHR$(8);",";
111 IF D=0 THEN PRINT " NO PEOPLE STARVED AND"; ELSE
IF D=1 THEN PRINT "1 PERSON STARVED AND"; ELSE
PRINT D;"PEOPLE STARVED AND";
112 IF I=0 THEN PRINT "NONE CAME TO THE CITY." ELSE
IF I=1 THEN PRINT "1 CAME TO THE CITY." ELSE
PRINT I;"CAME TO THE CITY."
120 P=P+I
130 IF Q>0 THEN 160
140 P=INT(P/2)
150 PRINT "A HORRIBLE PLAGUE STRUCK! HALF THE PEOPLE DIED."
160 PRINT "SO THE POPULATION IS NOW";P;CHR$(8);"."
170 PRINT "THE CITY NOW OWNS ";:IF A<1000 THEN PRINT USING "###";A; ELSE
IF A>=1000 AND A<10000 THEN PRINT USING "#,###";A; ELSE IF A>=10000
THEN PRINT USING "##,###";A;
171 PRINT " ACRES."
180 IF Y=0 THEN PRINT "THE HARVEST DID NOT YIELD ANY GRAIN." ELSE
IF Y=1 THEN PRINT "YOU HARVESTED 1 BUSHEL PER ACRE." ELSE
PRINT "YOU HARVESTED";Y;"BUSHELS PER ACRE."
190 IF E=0 THEN PRINT "THE RATS DID NOT EAT ANY GRAIN." ELSE
PRINT "THE RATS ATE";E;"BUSHELS."
200 PRINT "YOU NOW HAVE ";:IF S<1000 THEN PRINT USING "###";S; ELSE
IF S>=1000 AND S<10000 THEN PRINT USING "#,###";S; ELSE IF S>=10000
THEN PRINT USING "##,###";S;
201 PRINT " BUSHELS IN STORE.":PRINT
210 IF Z=11 THEN 970
220 C=INT(10*RND(1)): Y=C+17
230 PRINT "LAND IS TRADING AT";Y;"BUSHELS PER ACRE."
240 PRINT "HOW MANY ACRES DO YOU WISH TO BUY";
250 INPUT Q: IF Q<0 THEN 940
260 IF Y*Q<=S THEN 290
270 GOSUB 870
280 GOTO 240
290 IF Q=0 THEN 320
300 A=A+Q: S=S-Y*Q: C=0
310 GOTO 380
320 PRINT "HOW MANY ACRES DO YOU WISH TO SELL";
330 INPUT Q: IF Q<0 THEN 940
340 IF Q<A THEN 370
350 GOSUB 900
360 GOTO 320
370 A=A-Q: S=S+Y*Q: C=0
380 PRINT
390 PRINT "HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE";
400 INPUT Q
410 IF Q<0 THEN 940
420 REM *** TRYING TO USE MORE GRAIN THAN IS IN SILOS?
430 IF Q<=S THEN 460
440 GOSUB 870
450 GOTO 390
460 S=S-Q: C=1: PRINT
470 PRINT "HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED";
480 INPUT D: IF D=0 THEN 630
490 IF D<0 THEN 940
500 REM *** TRYING TO PLANT MORE ACRES THAN YOU OWN?
510 IF D<=A THEN 550
520 GOSUB 900
530 GOTO 470
540 REM *** ENOUGH GRAIN FOR SEED?
550 IF INT(D/2)<=S THEN 590
560 GOSUB 870
570 GOTO 470
580 REM *** ENOUGH PEOPLE TO TEND THE CROPS?
590 IF D<10*P THEN 620
600 PRINT "BUT YOU HAVE ONLY";P;"PEOPLE TO TEND THE FIELDS! NOW THEN,"
610 GOTO 470
620 S=S-INT(D/2)
630 GOSUB 920
640 REM *** A BOUNTIFUL HARVEST!
650 Y=C: H=D*Y: E=0
660 GOSUB 920
670 IF INT(C/2)<>C/2 THEN 700
680 REM *** RATS ARE RUNNING WILD!!
690 E=INT(S/C)
700 S=S-E+H
710 GOSUB 920
720 REM *** LET'S HAVE SOME BABIES
730 I=INT(C*(20*A+S)/P/100+1)
740 REM *** HOW MANY PEOPLE HAD FULL TUMMIES?
750 C=INT(Q/20)
760 REM *** HORROS, A 15% CHANCE OF PLAGUE
770 Q=INT(10*(2*RND(1)-.3))
780 IF P<C THEN 90
790 REM *** STARVE ENOUGH FOR IMPEACHMENT?
800 D=P-C: IF D>.45*P THEN 830
810 P1=((Z-1)*P1+D*100/P)/Z
820 P=C: D1=D1+D: GOTO 100
830 PRINT: PRINT "YOU STARVED";D;"PEOPLE IN ONE YEAR!!!"
840 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY"
850 PRINT "BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE"
860 PRINT "ALSO BEEN DECLARED NATIONAL FINK!!!!": GOTO 1170
870 PRINT "HAMURABI: THINK AGAIN. YOU HAVE ONLY"
880 PRINT S;"BUSHELS OF GRAIN. NOW THEN,"
890 RETURN
900 PRINT "HAMURABI: THINK AGAIN. YOU OWN ONLY";A;"ACRES. NOW THEN,"
910 RETURN
920 C=INT(RND(1)*5)+1
930 RETURN
940 PRINT: PRINT "HAMURABI: I CANNOT DO WHAT YOU WISH."
950 PRINT "GET YOURSELF ANOTHER STEWARD!!!!!"
960 GOTO 1170
970 PRINT "IN YOUR 10-YEAR TERM OF OFFICE,";P1;"PERCENT OF THE"
980 PRINT "POPULATION STARVED PER YEAR ON THE AVERAGE, I.E. A TOTAL OF"
990 PRINT D1;"PEOPLE DIED!!": L=A/P
1000 PRINT "YOU STARTED WITH 10 ACRES PER PERSON AND ENDED WITH"
1010 PRINT L;"ACRES PER PERSON.": PRINT
1020 IF P1>33 THEN 840
1030 IF L<7 THEN 840
1040 IF P1>10 THEN 1100
1050 IF L<9 THEN 1100
1060 IF P1>3 THEN 1130
1070 IF L<10 THEN 1130
1080 PRINT "A FANTASTIC PERFORMANCE!!! CHARLEMANGE, DISRAELI, AND"
1090 PRINT "JEFFERSON COMBINED COULD NOT HAVE DONE BETTER!":GOTO 1170
1100 PRINT "YOUR HEAVY-HANDED PERFORMANCE SMACKS OF NERO AND IVAN IV."
1110 PRINT "THE PEOPLE (REMIANING) FIND YOU AN UNPLEASANT RULER, AND,"
1120 PRINT "FRANKLY, HATE YOUR GUTS!!":GOTO 1170
1130 PRINT "YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT"
1140 PRINT "REALLY WASN'T TOO BAD AT ALL. ";INT(P*.8*RND(1));"PEOPLE"
1150 PRINT "WOULD DEARLY LIKE TO SEE YOU ASSASSINATED BUT WE ALL HAVE OUR"
1160 PRINT "TRIVIAL PROBLEMS."
1170 PRINT: FOR N=1 TO 10: PRINT CHR$(7);: NEXT N
1180 PRINT "SO LONG FOR NOW.": PRINT
1190 RUN "MENU"