Copyright Datamost
2140 NU$="fifth":SETCOLOR 2,7,1 :RETURN 21 50 NU$="sixth":SETCOLOR 2,0,1:RETURN 21 60 NU$="seventh":SETCOLOR 2,3,1 :RETURN 2170 NU$="eighth":SETCOLOR 2,4,1 :RETURN 2180 NU$="ninth":SETCOLOR 2,1,1:RETURN 2190 NU$="tenth":SETCOLOR 2,3,2:RETURN 2200 NU$="final":SETCOLOR 2,4,2:RETURN 2210 GOTO 4100
3005 PRINT "}" PRINT " *** KINGDOM ***"
3010 Z=Z+10
3020 GOSUB 2090+Z
3100 PRINT :PRINT
31 20 PRINT"Hamurabi, I beg to report to you that in the ";N US;" year of your reign,"
31 25 PRINT D," people starved."
3130 PRINT I;" new inhabitants came into the city."
3140 PRINT "Rats ate ";E;" bushels."
3280 P=P+I:IF 0=0 THEN P=INT(P/2):PRINT :PRINT "A horrible plague struck !!!
Half of your people perished____"
3285 PRINT
3290 PRINT "The population is ";P;"."
3295 PRINT "The city owns ";A;" acres."
3300 PRINT "You harvested ";Y;" bushels/acre."
3310 PRINT "You have ";S;" bushels in reserve."
3410 PRINT "Land is trading at ";Y;" bushels/acre."
3420 PRINT "How many acres do you wish to buy?"
3430 INPUT Q$:IF 0$="" THEN Q$="0"
3440 IF Q<0 OR Y*Q> THEN? "0 wise Hamurabi please consider,":? "you only have";S;"bushels of grain.":GOTO 3420
3450 IF Q>0 THEN A=A+Q:S=S-Y*Q:C=0:GOTO 3500 3453 PRINT "Land is trading at ";Y;" bushels/acre."
3460 PRINT "How many acres of the royal domain":PRINT "should we sell";
3470 INPUT Q$:IF Q$="" THEN Q$="0"
3480 IF Q>ATHEN PRINT"0 wisest of rulers, you only own ";A;" acres.":GOTO 3460 3490 A=A-Q: S=S+Y* Q: C=0
3500 PRINT "Of the ";S;" bushels remaining, how":PRINT "many do you wish to feed your":PRINT "people ";
3510 INPUT Q$:IF Q$="" THEN Q$="0"
3520 IF (Q<1) THEN PRINT" □ great one, please reconsider. The peasants will starve.":GOTO 3500 3530 IF Q>S THEN PRINT "Your beneficence exceeds the royal stores
□ mighty one.":GOTO 3500 3540 S=S-Q 3550 C=1
3560 PRINT "Of the ";A;" acres you now possess," 3570 PRINT "how many do you wish to plant with grain";
3580 INPUT DS:IF D$="" THEN D$="0"
3590 IF D<1 THEN PRINT "The people will starve 0 mighty one.":GOTO 3650 3600 IF (D/2)>S THEN PRINT "There is not seed enough for so much land.":GOTO 3560 361 0 IF D>10*P THEN PRINT "You can only force one peasant to work ten acres of land." 3620 IF D>10*P THEN PRINT "Your population of ";P;"
isn't big enought.":GOTO 3560 3630 S=S-INT(D/2) 3640 C=INT(RND(1 ]*5]+1 3650 Y=C 3660 H=D*Y 3670 E=0
3740 IF P<C THEN D=0:GOTO 3010
3750 D=P-C
3760 IF D>0.5*P THEN 3800 3770 P1=((Z-1 )*P1 +D*100/P]/Z 3780 P=C
3790 D1=D1 +D:GOTO 3010
3800 PRINT "0 mighty one you have failed your people and have been deposed." 381 0 PRINT "You have starved ";P;" peasants." 3820 WL=1
3830 FOR T=0 TO 255 STEP 4 3840 SOUND 0,T,10,10 3850 FOR PAUSE=1 TO 10:NEXT PAUSE 3860 NEXT T 3870 SOUND 0,0,0,0 3900 PRINT :PRINT 3910 GOTO 4300
3990 RETURN 4000 REM ***
41 00 PRINT "} *** This is the Report of *** the Revolutionary Tribunal " 4105 PRINT :PRINT
4110 PRINT "In ten years of your rule,";P1 *1 0;"% of the populous died each year." 41 20 PRINT "A total of ";D1;" peasants perished." 4130 L=A/P
4140 PRINT "When you started, each peasant had ten acres." 41 50 PRINT "Now each one has ";L;" acres." 4200 PRINT :PRINT
4220 IF P1 >33 OR L<7 THEN PRINT "You have been deposed and beheaded, as befits a despot.":GOTO 4300 4230 IF P1>10 OR L<9 THEN PRINT "You are banished from the kingdom.":GOTO 4300 4240 IF P1 >3 OR L<1 0 THEN PRINT "Only the upper classes wish you well.":GOTO 4300 4250 PRINT "You are wonderfully wise 0 great Hamurabi. Your reign will continue for many years" 4300 PRINT "Would you like to rule again"; 4310 INPUTANS$ 4320 IF ANS$="" THEN RUN 4330 IF ANS$(1,1 ]="Y" THEN RUN 4340 END 4990 RETURN
If your family has been on your case for playing computer games you can write this educational program that will do a few plane geometry calculations. The program demonstrates how to format screens and input prompts. You can do all sorts of computations and put the results in a PRINT statement. The examples here are very easy, but you could put in very complex calculations without the program being any more complex.
1020 REM* AREA
1030 REM*
"1 04-0 R EM ************************************ 1050 REM 1060 DIM A$(20] 1070 Pl=3.141 59
1080 GOTO 1190:REM SKIP SUBROUTINES 1090 GRAPHICS 0 1100 PRINT"}" 1110 POSITION 12,4 1120 PRINT"*** AREA ***" 1130 POSITION 2,8 1140 RETURN 1150 POSITION 2,23
1160 PRINT "PRESS 'RETURN' TO CONTINUE"; 1170 INPUT A$:IFA$="" THEN A$="0" 1180 RETURN
Post a comment