8K ROM Updates

See all articles from SYNC v2 n5

In the first issues of SYNC the programs were all for the 4K ROM. When the 8K ROM became available, we tried wherever possible to provide listings for both ROMs. Since we have had requests from readers for updated versions of some of the programs we published earlier, we will include these from time to time.

Translated to 8K ROM by James Grosjean.


Hurkle

Laura McLauglin

The Hurkle is hiding deep in the forest and you must find it by logical deduction. Type in the program, hit RUN and ENTER. The prompts will call for the input of two coordinates (X,Y) corresponding to a point on a 10×10 grid. The computer will then tell you in which direction the Hurkle is hiding. Again you enter a new set of coordinates and continue until you have found the Hurkle or used up your five guesses. The program fits in 1K RAM. With sufficient RAM, Hurkle could be expanded to show the grid on the screen and record your entries.

   1 CLS
2 LET A=INT (RND*10)+1
4 LET B=INT (RND*10)+1
6 FOR K=1 TO 5
8 PRINT "GUESS NUMBER ";K
10 PRINT "X COORD?"
12 INPUT X
14 PRINT "Y COORD?"
16 INPUT Y
18 IF ABS (X-A)+ABS (Y-B)=0 TH
EN GOTO 40
20 CLS
22 PRINT "X=";X;" Y=";Y;" ";
24 GOSUB 50
26 NEXT K
30 PRINT "SORRY, THAT IS 5 GUE
SSES."
32 PRINT "PLAY AGAIN?"
34 INPUT A$
36 IF NOT CODE A$=62 THEN STOP
38 RUN
40 PRINT "YOU FOUND HIM IN ";K
;" GUESSES."
42 GOTO 32
50 PRINT "GO ";
52 IF Y=B THEN GOTO 62
54 IF Y<B THEN GOTO 60
56 PRINT "SOUTH";
58 GOTO 62
60 PRINT "NORTH";
62 IF X=A THEN GOTO 72
64 IF X<A THEN GOTO 70
66 PRINT "WEST"
68 GOTO 72
70 PRINT "EAST"
72 PRINT
74 RETURN

Castle Doors

Weldon J. Horton, Ph.D.

Castle Doors is an adventure game that presents a new challenge with each playing and easy adjustment of the difficulty level. The object is to defeat the wizard.

Type in the program, hit RUN, and ENTER. The display will show your strength and ask whether you want to open a door or fight the wizard. The display will continue to confront you with options which will either use up your strength or add to your strength. When you feel your strength is sufficient, you may take on the wizard.

The variables in lines 26-34 may be changed to provide different challenge levels.

   2 PRINT
4 PRINT "WELCOME TO CASTLE DO
ORS"
8 LET B=RND*300
10 LET C=INT (RND*50)+1
12 GOSUB 200
22 PRINT "4: OPEN A DOOR 5: F
IGHT WIZARD"
26 LET D=INT (RND*8)+1
28 LET A=0
30 LET E=RND*50+1
32 LET F=INT (RND*100)
34 LET G=INT (RND*25)+1
38 INPUT O
40 CLS
41 IF O=5 THEN GOTO 176
42 LET A=INT (RND*(D*10+10))+1
43 GOTO (D+21)*2
44 LET A$="CYCLOPS"
45 GOTO 60
46 LET A$="WITCH"
47 GOTO 60
48 LET A$="DRAGON"
49 GOTO 60
50 LET A$="GARGOYLE"
51 GOTO 60
52 LET A$="ZOMBIE"
53 GOTO 60
58 GOTO 160
60 PRINT
62 PRINT
70 PRINT "YOUR OPPONENT IS A "
;A$
72 GOSUB 200
80 PRINT "ENTER 1: FIGHT 2:
BRIBE 3: RUN"
84 INPUT N
86 CLS
88 IF N=2 THEN GOTO 124
90 IF N=3 THEN GOTO 148
92 IF C<A THEN GOTO 176
94 GOSUB 200
104 PRINT "HOW MUCH STRENGTH WI
LL YOU USE?"
106 INPUT Q
108 CLS
109 PRINT
110 PRINT
112 IF Q>C THEN GOTO 94
114 IF Q>=A THEN LET C=C+G
116 IF Q>=A THEN PRINT "YOU WIN
BRAVE ADVENTURER"
118 IF Q<A THEN LET C=C-Q
120 IF Q<A THEN PRINT "YOU LOSE
TO THE ";A$
122 GOTO 12
124 GOSUB 200
132 PRINT "SIZE OF BRIBE?"
134 INPUT P
136 CLS
138 IF P>=E THEN LET C=C-P+G
140 IF P>=E THEN PRINT "ACCEPTE
D"
142 IF P<E THEN PRINT "REFUSED"
144 IF P<E THEN GOTO 60
146 GOTO 12
148 PRINT
150 PRINT
152 IF F=7 THEN GOTO 176
154 PRINT "YOU GOT AWAY"
156 LET C=C-INT (RND*15)+1
158 GOTO 12
160 PRINT
162 PRINT
164 IF D=6 THEN PRINT "SAVE PRI
NCESS AND GAIN 50 POINTS"
166 IF D=6 THEN LET C=C+50
168 IF D=7 THEN PRINT "A FAIRY
GIVES YOU A POTION WHICHDOUBLES
YOUR STRENGTH"
170 IF D=7 THEN LET C=C*2
172 IF D=8 THEN PRINT "A GIANT
BAT TAKES YOU TO ANOTHERDOOR"
174 GOTO 12
176 PRINT
178 PRINT
180 IF C>=B THEN PRINT "YOU KIL
LED THE WIZARD-YOU WIN"
182 IF C<B OR C<A OR C<1 OR F=7
THEN PRINT "YOU FOUGHT WELL BUT
LOST-GAME OVER"
184 STOP
200 PRINT
201 PRINT
202 PRINT "YOUR STRENGTH IS ";C
203 PRINT
204 PRINT
205 IF C<1 THEN GOTO 182
206 RETURN

Nicomachus

David Ahl

Type in the program, press RUN, and ENTER. The prompts on the screen will tell you what to do. Type in your entry followed by ENTER. The computer will then figure out your number by logical deduction. The program fits in 1K RAM, and runs better in SLOW mode.

  10 LET A$="WHEN DIVIDED BY "
20 LET B$=" ITS REMAINDER IS?
"
30 PRINT "THINK OF A NUMBER FR
OM 1 TO 100."
40 PRINT A$;3;B$;
50 INPUT A
60 PRINT A
70 PRINT A$;5;B$;
80 INPUT B
90 PRINT B
100 PRINT A$;7;B$;
110 INPUT C
120 PRINT C
130 PRINT "LET ME THINK A MOMEN
T..."
140 LET Y=70*A+21*B+15*C
150 IF Y<106 THEN GOTO 180
160 LET Y=Y-105
170 GOTO 150
180 PRINT "YOUR NUMBER WAS ";Y;
", RIGHT?"
190 INPUT A$
210 IF CODE A$=62 THEN PRINT "H
OW ABOUT THAT."
220 IF CODE A$=51 THEN PRINT "I
THINK YOU MISCALCULATED."
230 PRINT "WANT TO TRY ANOTHER?
(Y/N)"
240 INPUT D
250 CLS
260 RUN

Widget

Gary McGath

To play Widget type in the program, press RUN and ENTER. The screen prompts call for you to make executive decisions. Type in your decision and hit ENTER. After computing your decision, your ZX81 will post your new financial position and the number of many months you have been in business. The object of Widget is to avoid bankruptcy. The program requires a 2K machine.

   5 RAND
6 LET Z=1
10 LET P=1
20 LET M=900
30 LET I=0
40 LET S=10
100 CLS
110 PRINT "MONTH ";Z
120 LET Z=Z+1
300 PRINT "YOU HAVE";TAB 16;"$"
;M;"00"
310 PRINT TAB 8;P;" PLANTS"
320 PRINT TAB 8;I;"00 WIDGETS"
330 PRINT "LAST MONTH YOU SOLD
";S;"00"
350 IF M<1000 THEN GOTO 410
360 PRINT "BUY A PLANT?"
370 INPUT Y$
380 IF Y$<>"Y" THEN GOTO 410
390 LET P=P+1
400 LET M=M-1000
410 PRINT "AD BUDGET IN 1000S ?
"
420 INPUT B
430 IF B*10>M THEN GOTO 420
440 LET M=M-B*10
450 PRINT "PRODUCTION IN 100S ?
"
470 INPUT W
480 IF W>10*P THEN GOTO 470
490 LET I=I+W
500 LET S=INT (S/INT (RND*3+3))
510 IF B<6 THEN GOTO 550
520 LET S=S+(B-6)*5
530 LET B=6
550 IF B<2 THEN GOTO 600
560 LET S=S+(B-2)*7
570 LET B=2
600 LET S=S+B*8
610 IF S>I THEN LET S=I
620 LET M=M+S*10
630 LET I=I-S
640 LET M=M-20*P-20
650 LET M=M-(W-1)*5
660 IF M>=0 THEN GOTO 100
800 PRINT "YOU ARE BANKRUPT."