I am life, creator of worlds

HAMURABI:  I BEG TO REPORT TO YOU,
IN YEAR 10, 0 PEOPLE STARVED, 4 CAME TO THE CITY.
POPULATION IS NOW 97
THE CITY NOW OWNS 1000 ACRES.
YOU HARVESTED 5 BUSHELS PER ACRE.
RATS ATE 0 BUSHELS.
YOU NOW HAVE 8480 BUSHELS IN STORE.

IN YOUR 10-YEAR TERM OF OFFICE, 9.7269893 PERCENT OF THE
POPULATION STARVED PER YEAR ON AVERAGE, I.E., A TOTAL OF
 73 PEOPLE DIED!!
YOU STARTED WITH 10 ACRES PER PERSON AND ENDED WITH
 10.3092784 ACRES PER PERSON.
YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT
REALLY WASN'T TOO BAD AT ALL.  40 PEOPLE WOULD
DEARLY LIKE TO SEE YOU ASSASSINATED BUT WE ALL HAVE OUR
TRIVIAL PROBLEMS.

SO LONG FOR NOW.

bwBASIC:
So I tried out the basic interpreter and now I remember why I hate BASIC so much.
I am actually surprised that kate editor has highlight for BASIC, but then I should have known that. I had to screw around with it a bit to get it to run with bwbasic, but mostly it was the PRINT, which didn't like variables embedded in a bash-like fashion.



10 REM *** CONVERTED FROM THE ORIGINAL FOCAL PROGRAM AND MODIFIED
20 REM *** FOR EDUSYSTEM 70 BY DAVID AHL, DIGITAL
30 REM *** MODIFIED FOR 8K MICROSOFT BASIC BY PETER TURNBULL
80 PRINT "TRY YOUR HAND AT GOVERNING ANCIENT SUMERIA"
85 PRINT "SUCCESSFULLY FOR A 10-YR TERM OF OFFICE."
86 PRINT
90 REM RANDOMIZE REMOVED
95 D1=0:P1=0
110 Z=0:P=95:S=2800:H=3000:E=H-S
120 Y=3:A=H/Y:I=5:Q=1
210 D=0
215 PRINT
216 PRINT "HAMURABI:  I BEG TO REPORT TO YOU,"
217 GOSUB 1000
218 P=P+I
227 IF Q>0 THEN 230
228 P=INT(P/2)
229 PRINT "A HORRIBLE PLAGUE STRUCK!  HALF THE PEOPLE DIED."
230 PRINT "POPULATION IS NOW";P 
232 PRINT "THE CITY NOW OWNS";A;
233 PRINT " ACRES."
235 PRINT "YOU HARVESTED";Y;
236 PRINT " BUSHELS PER ACRE."
250 PRINT "RATS ATE";E;
251 PRINT " BUSHELS."
260 PRINT "YOU NOW HAVE";S;
261 PRINT " BUSHELS IN STORE."
262 PRINT
270 IF Z=11 THEN 860
310 C=INT(10*RND(1)):Y=C+17
312 PRINT "LAND IS TRADING AT";Y;
313 PRINT " BUSHELS PER ACRE."
320 PRINT "HOW MANY ACRES DO YOU WISH TO BUY";
321 INPUT Q:IF Q<0 THEN 850
322 IF Y*Q<=S THEN 330
323 GOSUB 710
324 GOTO 320 
330 IF Q=0 THEN 340
331 A=A+Q:S=S-Y*Q:C=0
334 GOTO 400
340 PRINT "HOW MANY ACRES DO YOU WISH TO SELL";
341 INPUT Q:IF Q<0 THEN 850
342 IF Q<A THEN 350
343 GOSUB 720
344 GOTO 340 
350 A=A-Q:S=S+Y*Q:C=0
400 PRINT
410 PRINT "HOW MANY BUSHELS DO YOU WISH TO FEED YOUR PEOPLE";
411 INPUT Q
412 IF Q<0 THEN 850
418 REM *** TRYING TO USE MORE GRAIN THAN IN THE SILOS?
420 IF Q<=S THEN 430 
421 GOSUB 710
422 GOTO 410 
430 S=S-Q:C=1
431 PRINT
440 PRINT "HOW MANY ACRES DO YOU WISH TO PLANT WITH SEED";
441 INPUT D:IF D=0 THEN 511
442 IF D<0 THEN 850
444 REM *** TRYING TO PLANT MORE ACRES THAN YOU OWN?
445 IF D<=A THEN 450
446 GOSUB 720
447 GOTO 440
449 REM *** ENOUGH GRAIN FOR SEED?
450 IF INT(D/2)<S THEN 455
452 GOSUB 710
453 GOTO 440 
454 REM *** ENOUGH PEOPLE TO TEND THE CROPS?
455 IF D<10*P THEN 510
460 PRINT "BUT YOU HAVE ONLY";P;
461 PRINT " PEOPLE TO TEND THE FIELDS. NOW THEN,"
470 GOTO 440
510 S=S-INT(D/2)
511 GOSUB 800
512 REM *** A BOUNTYFULL HARVEST!!
515 Y=C:H=D*Y:E=0
521 GOSUB 800
522 IF INT(C/2)<>C/2 THEN 530
523 REM *** THE RATS ARE RUNNING WILD!!
525 E=INT(S/C)
530 S=S-E+H
531 GOSUB 800
532 REM *** LET'S HAVE SOME BABIES
533 I=INT(C*(20*A+S)/P/100+1)
539 REM *** HOW MANY PEOPLE HAD FULL TUMMIES?
540 C=INT(Q/20)
541 REM *** HORRORS, A 15% CHANCE OF PLAGUE
542 Q=INT(10*(2*RND(1)-.3))
550 IF P<C THEN 210
551 REM *** STARVE ENOUGH FOR IMPEACHMENT?
552 D=P-C:IF D>.45*P THEN 560
553 P1=((Z-1)*P1+D*100/P)/Z
555 P=C:D1=D1+D:GOTO 215
560 PRINT "YOU STARVED";D;
561 PRINT " PEOPLE IN ONE YEAR!!!"
565 PRINT "DUE TO THIS EXTREME MISMANAGEMENT YOU HAVE NOT ONLY"
566 PRINT "BEEN IMPEACHED AND THROWN OUT OF OFFICE BUT YOU HAVE"
567 PRINT "ALSO BEEN DECLARED 'NATIONAL FINK' !!"
568 GOTO 990
710 PRINT "HAMURABI:  THINK AGAIN. YOU HAVE ONLY"
711 PRINT S;
712 PRINT " BUSHELS OF GRAIN.  NOW THEN,"
713 RETURN 
720 PRINT "HAMURABI:  THINK AGAIN. YOU OWN ONLY";A;
721 PRINT " ACRES.  NOW THEN,"
730 RETURN
800 C=INT(RND(1)*5)+1
801 RETURN 
850 PRINT "HAMURABI:  I CANNOT DO WHAT YOU WISH."
855 PRINT "GET YOURSELF ANOTHER STEWARD!!!!!"
857 GOTO 990
860 PRINT "IN YOUR 10-YEAR TERM OF OFFICE,";P1;
861 PRINT " PERCENT OF THE"
862 PRINT "POPULATION STARVED PER YEAR ON AVERAGE, I.E., A TOTAL OF"
865 PRINT D1;
866 PRINT " PEOPLE DIED!!"
867 L=A/P
870 PRINT "YOU STARTED WITH 10 ACRES PER PERSON AND ENDED WITH"
875 PRINT L;
876 PRINT " ACRES PER PERSON."
880 IF P1>33 THEN 565
885 IF L<7 THEN 565
890 IF P1>10 THEN 940
892 IF L<9 THEN 940
895 IF P1>3 THEN 960
896 IF L<10 THEN 960
900 PRINT "A FANTASTIC PERFORMANCE!!!  CHARLEMANGE, DISRAELI, AND"
905 PRINT "JEFFERSON COMBINED COULD NOT HAVE DONE BETTER!"
906 GOTO 990
940 PRINT "YOUR HEAVY-HANDED PERFORMANCE SMACKS OF NERO AND IVAN IV."
945 PRINT "THE PEOPLE (REMAINING) FIND YOU AN UNPLEASANT RULER, AND,"
950 PRINT "FRANKLY, HATE YOUR GUTS!"
951 GOTO 990
960 PRINT "YOUR PERFORMANCE COULD HAVE BEEN SOMEWHAT BETTER, BUT"
965 PRINT "REALLY WASN'T TOO BAD AT ALL. ";
966 PRINT INT(P*.8*RND(1));" PEOPLE WOULD"
970 PRINT "DEARLY LIKE TO SEE YOU ASSASSINATED BUT WE ALL HAVE OUR"
975 PRINT "TRIVIAL PROBLEMS."
990 PRINT
991 FOR N=1 TO 10
992 PRINT CHR$(7);
993 NEXT N
995 PRINT "SO LONG FOR NOW."
996 PRINT
999 END
1000 PRINT "IN YEAR"; Z;
1001 PRINT ","; D ;
1002 PRINT " PEOPLE STARVED,"; I ;
1003 PRINT " CAME TO THE CITY."
1004 Z=Z+1
1005 RETURN



The entire thing is trivial, including the interpreter, so not much to be seen here.

 Obi wan kenobi: "These aren't the programs you are looking for."

Did I hear you say:
 " These aren't the programs we're looking for."

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen