Civilization for the ZX81
Christof Schatz
Email: schatz@lrz.tu-muenchen.de
Here my 'last creation' for the Zeddy: The 4K-Version of the game 'Civilization' (Original from
Sid Meier, Microprose).
How to play?
There are 2 civilitations, each localized in a city, which you can recognize as negative c-letters on
the map appearing after the start. Below the map are the values indicating the state of your
civilization.
Civ: The Production Power
Mil: The Power of the Home Army
Att: The Power of the mobile Troops.
From the Zeddy Civiziation, only the Production Power is shown. The rounds are managed as
follows:
After 'Mil' enter the production power, you want to invest in the Home Army. Respect that
only the production ressources have an implicite growth!
Now, the Zeddy actualizes the values and asks for a string. Here you may enter a 'b' for
'Build a mobile army'. In this case and only if your home force (value after 'Mil') is greater equal
10, a mobile army is set up. The costs of this setup is 10, the rest goes in the force of the mobile
troops. If you don't want to build troops, just type NEWLINE.
Once you have built mobile troops they are shown as a 'S' on the map. In the next step, you
are asked where to move your troops. Use the numbers '5' to '8' according to the cursor arrows
on the keyboard. (Don't forget NEWLINE! It's an Input!)
Similar the Zeddy may have built his troops (his troops are shown as a 'T') and moved them
just before. Each civilization can have only one mobile troop. You can't see the force of the
Zeddy troop until you have attacked it.
If you have a troop, you may now attack the Zeddy troop (if existing) or the Zeddy City. Or
your troop or city is itself attacked by the Zeddy troop. Attacks are driven simply by stepping
into the symbol, you want to attack. The point is: The mobile troop is a better defending troop
than the Home Army, because the latter cannot prevent damages to the production in the city.
After a battle between the mobile troops, 2 numbers after 'ATT' inform about the remaining
strength of the units. The strength of your own troop is given exactly, the strength of the 'T'-troop
is given on a logarithmic scale. ('2': Quite poor, '5': Quite strong).
If the attack force of one of the troops becomes negativ, the troop is destroyed and you can
build a new one (unless you have no ressources...). The negativ value of the destroyed troop may
inforce the other troop.
If the Power of the Home Army goes negative the game is NOT finished. This causes 'only'
an increase in strength of the attacking troops and serious production damages. The game is only
finished by a negative production power. Then the Zeddy stops with the error message A/1200
(You have lost) or A/1210 (Zeddy has lost).
Here the listing:
----- LEGENDA -----
[A] means INVERSE A
{A} means GRAPHICS A
----- START OF LISTING -----
100 LET DF=PEEK 16396+256*PEEK 16397
105 LET I=VAL "0"
200 LET M1=I
220 LET K1=VAL "1"
230 LET M2=M1
250 LET K2=K1
260 LET T=I
270 LET S=T
280 LET TM=T
290 LET SM=T
310 LET PM=VAL "0.05+RND*0.1"
320 LET PI=VAL "RND*10"
340 LET SX=VAL "31"
345 LET SY=T
350 LET TX=SX
355 LET TY=T
360 LET S$=""
365 LET T$=""
410 GOSUB VAL "500"
415 LET I=VAL "0"
420 LET I=I+VAL "1"
425 GOSUB VAL "650"
430 GOSUB 800
440 GOTO 420
495 STOP
500 PRINT AT VAL "2",VAL "5";"{E}{7}{7}{7}{7}{7}{7}{7}{R}"
550 PRINT AT VAL "10",VAL "5";"{W}{6}{6}{6}{6}{6}{6}{6}{Q}"
560 PRINT AT VAL "3",VAL "9";"[C]"
570 PRINT AT VAL "9",VAL "9";"[C]"
580 PRINT AT VAL "12",VAL "5";"[C][I][T][Y][1]";
590 PRINT TAB VAL "16";"[C][I][T][Y][2]"
600 PRINT " CIV",," MIL",," ATT"
630 RETURN
650 PRINT AT VAL "13",VAL "0";INT K1;" ",INT K2;" "
700 PRINT INT M1;" ",,INT SM;" "
730 IF T=VAL "1" THEN PRINT AT TY,TX;"T"
740 IF S=VAL "1" THEN PRINT AT SY,SX;"S"
790 RETURN
820 PRINT AT VAL "20",VAL "1";"MIL "
830 INPUT B
840 LET K1=K1-B
860 LET M1=M1+B
880 LET B=PM*K2
886 IF I
890 LET K2=K2-B
910 LET M2=M2+B
920 GOSUB 650
930 INPUT B$
1000 IF M2>=VAL "10" AND T<>VAL "1" THEN GOSUB 2000
1010 IF B$="B" AND S<>VAL "1" THEN GOSUB 2050
1020 IF T=VAL "0" THEN GOTO 1105
1035 LET VX=TX
1040 LET VY=TY
1050 GOSUB 2180
1060 LET X=TX
1070 LET Y=TY
1080 GOSUB 3000
1090 LET TX=X
1100 LET TY=Y
1103 GOSUB 2600
1105 IF S=VAL "0" THEN GOTO 1190
1107 LET UX=SX
1108 LET UY=SY
1110 GOSUB 2350
1115 GOSUB 2550
1200 LET K1=VAL "K1+SQR (1.7*K1)"
1210 LET K2=VAL "K2+SQR (2.2*K2)"
1220 RETURN
2000 IF M2
2004 LET TX=VAL "9"
2005 LET TY=VAL "9"
2010 LET T$="[C]"
2015 LET T=VAL "1"
2020 LET TM=M2-VAL "10"
2035 LET M2=VAL "0"
2037 GOSUB 650
2040 RETURN
2050 LET S=VAL "1"
2060 LET SX=VAL "9"
2070 LET SY=VAL "3"
2075 LET S$="[C]"
2080 LET SM=M1-VAL "10"
2085 LET M1=VAL "0"
2087 GOSUB 650
2090 RETURN
2180 IF TY<>3 THEN GOTO 2200
2185 IF TX<9 THEN GOTO 2230
2186 IF TX>9 THEN GOTO 2240
2200 IF T
2220 IF T
2230 LET TX=TX+T
2235 RETURN
2240 LET TX=TX-T
2250 RETURN
2270 LET TY=TY-T
2280 RETURN
2360 PRINT AT VAL "20",VAL "1";"MOVE: "
2370 INPUT A
2380 IF A=VAL "5" THEN LET SX=SX-S
2390 IF A=VAL "6" THEN LET SY=SY+S
2400 IF A=VAL "7" THEN LET SY=SY-S
2410 IF A=VAL "8" THEN LET SX=SX+S
2440 RETURN
2550 LET B$=CHR$ PEEK VAL "DF+SY*33+SX+1"
2560 IF B$="T" THEN GOTO 2800
2570 IF B$="[C]" AND SY=VAL "9" THEN GOTO 2750
2575 PRINT AT UY,UX;S$
2580 LET S$=B$
2590 GOSUB 730
2595 RETURN
2600 IF TX=VX AND TY=VY THEN RETURN
2605 LET B$=CHR$ PEEK VAL "DF+TY*33+TX+1"
2610 IF B$="S" THEN GOTO 2820
2620 IF B$="[C]" AND TY=VAL "3" THEN GOTO 2700
2625 PRINT AT VY,VX;T$
2630 LET T$=B$
2635 GOSUB 730
2640 RETURN
2700 LET A=RND*TM
2710 LET TM=TM-VAL "RND*M1/2"
2720 LET M1=M1-A
2725 LET B=A-VAL "RND*M1/2"
2730 LET K1=K1-B+(B
2732 LET TX=VX
2735 LET TY=VY
2740 GOTO 2880
2750 LET A=RND*SM
2760 LET SM=SM-VAL "RND*M2/2"
2770 LET M2=M2-A
2775 LET B=A-VAL "RND*M2/2"
2780 LET K2=K2-B+(B
2782 LET SX=UX
2784 LET SY=UY
2785 GOTO 2880
2800 LET SX=UX
2810 LET SY=UY
2815 GOTO 2830
2820 LET TX=VX
2825 LET TY=VY
2830 LET SM=SM-RND*TM
2850 LET TM=TM-RND*SM
2860 IF TM>VAL "0" THEN PRINT AT VAL "15",VAL "16";INT LN TM
2880 LET T=(TM>=VAL "0") AND T
2890 LET S=(SM>=VAL "0") AND S
2900 IF S=VAL "0" AND SX<>VAL "31" THEN GOTO VAL "2950"
2910 IF T=VAL "0" AND TX<>VAL "31" THEN GOTO VAL "2980"
2915 GOSUB 650
2920 RETURN
2950 PRINT AT SY,SX;S$
2960 LET SX=VAL "31"
2970 GOTO VAL "2915"
2980 PRINT AT TY,TX;T$
2990 LET TX=VAL "31"
2995 GOTO VAL "2915"
3000 IF X
3010 IF X
3020 IF X>VAL "12" THEN LET Y=VAL "12"
3030 IF Y
3040 IF Y>VAL "9" THEN LET Y=VAL "9"
3050 RETURN
----- END OF LISTING -----
Download
civ4.zip and rename it to civ.p (No Unzip!)
The download file is the program file for the Delhez-ZX81-Emulator for PCs.
To the ZX-Team