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"
