Friday, June 25, 2004

A Tiny BASIC Adventure Game?


I wrote this article on alt.lang.basic and comp.lang.basic.misc, and wanted to share it with PowerBASIC users because I've been trying to convert this game over to Tiny BASIC from a PowerBASIC version I wrote sometime ago (but never released).

I even received an email from Tom Pittman (one of the many authors of Tiny BASIC in the mid-1970s). He suggested I simulate string use via the USR command (I even tried the INP and PEEK functions, but both failed to do anything useful for my needs).

See below:

Tom,

The main problem is actually two-fold:

First, there is no way to adequately simulate string input from the user. In Sylvain Bizoirre's MINI-BASIC, this can be semi-accomplished courtesy of GET/INPUT emitting CHR character codes for each letter entered by the user. However, in 8086 Tiny BASIC, a suggested work around to this problem (suggested by Tom Pittman) was to use USR instead. I compiled his version
of Tiny BASIC from the C source. However, I couldn't load or save anything in the editor, and went back to using 8086 Tiny BASIC instead.

A second problem with 8086 Tiny BASIC is the lack of available memory. I've written less than 20% of the game's code, and already 90% of the memory has been exhausted. It would seem that such an adventure as outlined in the previous post would be possible (even in Tiny BASIC), but at the present time I'm wondering if even that assumption is true.

The workaround I used for my game Dark Forest II is published below (this is just the parser idea I came up with from a lucid dream I had a few years ago):

23 F=0:C=0:A=0:B=0:Y=0:Z=0:J=0:X=1:N=0:COLOR 15,1:PRINT ">";
24 J=A:GET A:IF A=27 PRINT:PRINT "Thanks for playing!":STOP
25 IF A=32 B=1:Y=F:PRINT " ";
26 IF A=8 GOTO 24
27 IF A=13 A=F:Z=F:GOTO 29
28 F=F+A:C=C+1:COLOR 11,1:GOTO 32
29 PRINT:COLOR 15,1:GOTO 100
30 LOCATE X,C-1:PRINT " ":LOCATE X,C-1:RETURN
31 IF C>0 F=F-J:LOCATE X,C-1:PRINT " ":LOCATE X,C-1: RETURN
32 IF A=97 PRINT "a";
33 IF A=98 PRINT "b";
34 IF A=99 PRINT "c";
35 IF A=100 PRINT "d";
36 IF A=101 PRINT "e";
37 IF A=102 PRINT "f";
38 IF A=103 PRINT "g";
39 IF A=104 PRINT "h";
40 IF A=105 PRINT "i";
41 IF A=106 PRINT "j";
42 IF A=107 PRINT "k";
43 IF A=108 PRINT "l";
44 IF A=109 PRINT "m";
45 IF A=110 PRINT "n";
46 IF A=111 PRINT "o";
47 IF A=112 PRINT "p";
48 IF A=113 PRINT "q";
49 IF A=114 PRINT "r";
50 IF A=115 PRINT "s";
51 IF A=116 PRINT "t";
52 IF A=117 PRINT "u";
53 IF A=118 PRINT "v";
54 IF A=119 PRINT "w";
55 IF A=120 PRINT "x";
56 IF A=121 PRINT "y";
57 IF A=122 PRINT "z";
58 GOTO 24
100 N=0:IF F=555 PRINT "Use abbrev.":GOTO 23
101 IF F=563 PRINT "Use abbrev.":GOTO 23
102 IF F=429 PRINT "Use abbrev.":GOTO 23
103 IF F=451 PRINT "Use abbrev.":GOTO 23
104 IF F=229 PRINT "Use abbrev.":GOTO 23
105 IF F=440 PRINT "Use abbrev.":GOTO 23
106 IF F=110 N=1
107 IF F=115 N=2
108 IF F=101 N=3

etc...

I added up words by their ASCII character value, so that commands as complex as:

EXAMINE LANTERN

or

WIELD BROADSWORD

could be simulated by adding all the letters together:

E+X+A+M+I+N+E+ +B+R+O+A+D+S+W+O+R+D = some number

An older version of Dark Forest II, as it runs under MINI-BASIC, is listed below:

1 COLOR 15,1:CLS:PRINT "Dark Forest II":COLOR 7,1:PRINT "By Paul Panks":PRINT
2 COLOR 11,1:PRINT "Version 1.32":PRINT:COLOR 15,1
3 PRINT "It has been three years since you ventured into the Dark Forest"
4 PRINT "to slay the evil dragon within. As your legend grew, so did your"
5 PRINT "notoriety. From far away lands people saught your skills and"
6 PRINT "unrelenting bravery. You rest on your spoils and set aside"
7 PRINT "your sword, hoping to forever retire from the blade.":PRINT
8 PRINT "But recently, wild stories have emerged from the outskirts of town."
9 PRINT "Stories of vampires haunting the forest, and sucking dry the very"
10 PRINT "blood of mortal men. Scared and afraid, the villagers have retreated"
11 PRINT "into the mountains. It is up to you alone to see if such stories are true."
12 PRINT "For if they are, then your blade may not be useless just yet...":PRINT
13 COLOR 14,1:PRINT "Press ENTER to begin!"
14 GET A:IF A=13 GOTO 16
15 GOTO 14
16 CLS:COLOR 15,1:@(1)=4:@(2)=99:@(3)=4:@(4)=22:@(5)=22:@(6)=-1:@(7)=99:@(8)=1025:@(9)=1028:@(10)=99
17 @(11)=1023:@(12)=15:@(13)=1029:@(14)=1023:@(15)=106:@(16)=-1:@(17)=1025:@(18)=1026:@(19)=1026
18 @(20)=3:@(21)=8:@(22)=25:@(23)=42:@(24)=34:@(25)=37:@(26)=33:@(27)=15
19 @(28)=45:@(29)=47:@(30)=47:@(31)=25:@(32)=29
20 R=1:H=275:G=250:E=0:L=0:U=0
21 A=0:COLOR 7,1:GOTO 3500
22 GOTO 3800
23 F=0:C=0:A=0:B=0:Y=0:Z=0:J=0:X=1:N=0:COLOR 15,1:PRINT ">";
24 J=A:GET A:IF A=27 PRINT:PRINT "Thanks for playing!":STOP
25 IF A=32 B=1:Y=F:PRINT " ";
26 IF A=8 GOTO 24
27 IF A=13 A=F:Z=F:GOTO 29
28 F=F+A:C=C+1:COLOR 11,1:GOTO 32
29 PRINT:COLOR 15,1:GOTO 100
30 LOCATE X,C-1:PRINT " ":LOCATE X,C-1:RETURN
31 IF C>0 F=F-J:LOCATE X,C-1:PRINT " ":LOCATE X,C-1: RETURN
32 IF A=97 PRINT "a";
33 IF A=98 PRINT "b";
34 IF A=99 PRINT "c";
35 IF A=100 PRINT "d";
36 IF A=101 PRINT "e";
37 IF A=102 PRINT "f";
38 IF A=103 PRINT "g";
39 IF A=104 PRINT "h";
40 IF A=105 PRINT "i";
41 IF A=106 PRINT "j";
42 IF A=107 PRINT "k";
43 IF A=108 PRINT "l";
44 IF A=109 PRINT "m";
45 IF A=110 PRINT "n";
46 IF A=111 PRINT "o";
47 IF A=112 PRINT "p";
48 IF A=113 PRINT "q";
49 IF A=114 PRINT "r";
50 IF A=115 PRINT "s";
51 IF A=116 PRINT "t";
52 IF A=117 PRINT "u";
53 IF A=118 PRINT "v";
54 IF A=119 PRINT "w";
55 IF A=120 PRINT "x";
56 IF A=121 PRINT "y";
57 IF A=122 PRINT "z";
58 GOTO 24
100 N=0:IF F=555 PRINT "Use abbrev.":GOTO 23
101 IF F=563 PRINT "Use abbrev.":GOTO 23
102 IF F=429 PRINT "Use abbrev.":GOTO 23
103 IF F=451 PRINT "Use abbrev.":GOTO 23
104 IF F=229 PRINT "Use abbrev.":GOTO 23
105 IF F=440 PRINT "Use abbrev.":GOTO 23
106 IF F=110 N=1
107 IF F=115 N=2
108 IF F=101 N=3
109 IF F=119 N=4
110 IF F=117 N=5
111 IF F=100 N=6
112 IF N=0 GOTO 114
113 GOTO 1997
114 COLOR 15,1
115 IF F=105 O=R:R=-1
116 IF F=1006 O=R:R=-1
117 IF F=1006 GOTO 3800
118 IF F=105 GOTO 3800
119 IF F=1108 IF @(1)=R @(1)=-1:PRINT "Taken.":GOTO 23
120 IF F=676 IF @(2)=R @(2)=-1:PRINT "Taken.":GOTO 23
121 IF F=790 IF @(3)=R @(3)=-1:PRINT "Taken.":GOTO 23
122 IF F=681 IF @(4)=R @(4)=-1:PRINT "Taken.":GOTO 23
123 IF F=1002 IF @(5)=R @(5)=-1:PRINT "Taken.":GOTO 23
124 IF F=970 IF @(6)=R @(6)=-1:PRINT "Taken.":GOTO 23
125 IF F=911 IF @(7)=R @(7)=-1:PRINT "Taken.":GOTO 23
126 IF F=670 IF @(8)=R @(8)=-1:PRINT "Taken.":GOTO 23
127 IF F=1212 IF @(9)=R @(9)=-1:PRINT "Taken.":GOTO 23
128 IF F=1343 IF @(10)=R @(10)=-1:PRINT "Taken.":GOTO 23
129 IF F=1431 IF @(11)=R @(11)=-1:PRINT "Taken.":GOTO 23
130 IF F=1306 IF @(12)=R @(12)=-1:PRINT "Taken.":GOTO 23
131 IF F=1090 IF @(13)=R @(13)=-1:PRINT "Taken.":GOTO 23
132 IF F=897 IF @(14)=R @(14)=-1:PRINT "Taken.":GOTO 23
133 IF F=985 IF @(15)=R @(15)=-1:PRINT "Taken.":GOTO 23
134 IF F=991 IF @(16)=R @(16)=-1:PRINT "Taken.":GOTO 23
135 IF F=1335 IF @(17)=R @(17)=-1:PRINT "Taken.":GOTO 23
136 IF F=874 IF @(18)=R @(18)=-1:PRINT "Taken.":GOTO 23
137 IF F=784 IF @(19)=R @(19)=-1:PRINT "Taken.":GOTO 23
138 IF F=1225 IF @(1)=-1 @(1)=R:PRINT "Dropped.":GOTO 23
139 IF F=793 IF @(2)=-1 @(2)=R:PRINT "Dropped.":GOTO 23
140 IF F=907 IF @(3)=-1 @(3)=R:PRINT "Dropped.":GOTO 23
141 IF F=798 IF @(4)=-1 @(4)=R:PRINT "Dropped.":GOTO 23
142 IF F=1119 IF @(5)=-1 @(5)=R:PRINT "Dropped.":GOTO 23
143 IF F=1087 IF @(6)=-1 @(6)=R:PRINT "Dropped.":GOTO 23
144 IF F=1028 IF @(7)=-1 @(7)=R:PRINT "Dropped.":GOTO 23
145 IF F=787 IF @(8)=-1 @(8)=R:PRINT "Dropped.":GOTO 23
146 IF F=1329 IF @(9)=-1 @(9)=R:PRINT "Dropped.":GOTO 23
147 IF F=1460 IF @(10)=-1 @(10)=R:PRINT "Dropped.":GOTO 23
148 IF F=1548 IF @(11)=-1 @(11)=R:PRINT "Dropped.":GOTO 23
149 IF F=1423 IF @(12)=-1 @(12)=R:PRINT "Dropped.":GOTO 23
150 IF F=1207 IF @(13)=-1 @(13)=R:PRINT "Dropped.":GOTO 23
151 IF F=1014 IF @(14)=-1 @(14)=R:PRINT "Dropped.":GOTO 23
152 IF F=1102 IF @(15)=-1 @(15)=R:PRINT "Dropped.":GOTO 23
153 IF F=1108 IF @(16)=-1 @(16)=R:PRINT "Dropped.":GOTO 23
154 IF F=1452 IF @(17)=-1 @(17)=R:PRINT "Dropped.":GOTO 23
155 IF F=991 IF @(18)=-1 @(18)=R:PRINT "Dropped.":GOTO 23
156 IF F=993 IF @(19)=-1 @(19)=R:PRINT "Dropped.":GOTO 23
157 IF F=1183 IF @(6)=-1 S=6:GOTO 3900
158 IF F=1124 IF @(7)=-1 S=7:GOTO 3900
159 IF F=883 IF @(8)=-1 S=8:GOTO 3900
160 IF F=1425 IF @(9)=-1 S=9:GOTO 3900
161 IF F=1556 IF @(10)=-1 S=10:GOTO 3900
162 IF F=1644 IF @(11)=-1 S=11:GOTO 3900
163 IF F=1519 IF @(12)=-1 S=12:GOTO 3900
164 IF F=1303 IF @(13)=-1 S=13:GOTO 3900
170 IF F=1410 IF @(6)=105 @(6)=-1:PRINT "Unwielded.":GOTO 23
171 IF F=1351 IF @(7)=105 @(7)=-1:PRINT "Unwielded.":GOTO 23
172 IF F=1110 IF @(8)=105 @(8)=-1:PRINT "Unwielded.":GOTO 23
173 IF F=1652 IF @(9)=105 @(9)=-1:PRINT "Unwielded.":GOTO 23
174 IF F=1783 IF @(10)=105 @(10)=-1:PRINT "Unwielded.":GOTO 23
175 IF F=1871 IF @(11)=105 @(11)=-1:PRINT "Unwielded.":GOTO 23
176 IF F=1746 IF @(12)=105 @(12)=-1:PRINT "Unwielded.":GOTO 23
177 IF F=1530 IF @(13)=105 @(13)=-1:PRINT "Unwielded.":GOTO 23
180 IF F=1008 IF @(14)=-1 @(14)=205:PRINT "Worn.":GOTO 23
181 IF F=1096 IF @(15)=-1 @(15)=205:PRINT "Worn.":GOTO 23
182 IF F=1102 IF @(16)=-1 @(16)=205:PRINT "Worn.":GOTO 23
183 IF F=1446 IF @(17)=-1 @(17)=205:PRINT "Worn.":GOTO 23
184 IF F=985 IF @(18)=-1 @(18)=205:PRINT "Worn.":GOTO 23
185 IF F=895 IF @(19)=-1 @(19)=205:PRINT "Worn.":GOTO 23
190 IF F=1231 IF @(14)=205 @(14)=-1:PRINT "Removed.":GOTO 23
191 IF F=1319 IF @(15)=205 @(15)=-1:PRINT "Removed.":GOTO 23
192 IF F=1325 IF @(16)=205 @(16)=-1:PRINT "Removed.":GOTO 23
193 IF F=1669 IF @(17)=205 @(17)=-1:PRINT "Removed.":GOTO 23
194 IF F=1208 IF @(18)=205 @(18)=-1:PRINT "Removed.":GOTO 23
195 IF F=1118 IF @(19)=205 @(19)=-1:PRINT "Removed.":GOTO 23
196 IF F=108 GOTO 21
197 IF F=437 GOTO 21
198 IF F=1531 IF @(30)=R COLOR 7,1:PRINT "vampire: This is the evil vampire. He has sharp fangs and a deadly gaze!":GOTO 23
200 IF F=1531 IF @(1)=R GOTO 4201
201 IF F=1531 IF @(1)=-1 GOTO 4201
202 IF F=1099 IF @(2)=R GOTO 4202
203 IF F=1099 IF @(2)=-1 GOTO 4202
204 IF F=1213 IF @(3)=R GOTO 4203
205 IF F=1213 IF @(3)=-1 GOTO 4203
206 IF F=1104 IF @(4)=R GOTO 4204
207 IF F=1104 IF @(4)=-1 GOTO 4204
208 IF F=1425 IF @(5)=R GOTO 4205
209 IF F=1425 IF @(5)=-1 GOTO 4205
210 IF F=1393 IF @(6)=R GOTO 4206
211 IF F=1393 IF @(6)=-1 GOTO 4206
212 IF F=1393 IF @(6)=105 GOTO 4206
213 IF F=1334 IF @(7)=R GOTO 4207
214 IF F=1334 IF @(7)=-1 GOTO 4207
215 IF F=1334 IF @(7)=105 GOTO 4207
216 IF F=1093 IF @(8)=R GOTO 4208
217 IF F=1093 IF @(8)=-1 GOTO 4208
218 IF F=1093 IF @(8)=105 GOTO 4208
219 IF F=1635 IF @(9)=R GOTO 4209
220 IF F=1635 IF @(9)=-1 GOTO 4209
221 IF F=1635 IF @(9)=105 GOTO 4209
222 IF F=1766 IF @(10)=R GOTO 4210
223 IF F=1766 IF @(10)=-1 GOTO 4210
224 IF F=1766 IF @(10)=105 GOTO 4210
225 IF F=1854 IF @(11)=R GOTO 4211
226 IF F=1854 IF @(11)=-1 GOTO 4211
227 IF F=1854 IF @(11)=105 GOTO 4211
228 IF F=1729 IF @(12)=R GOTO 4212
229 IF F=1729 IF @(12)=-1 GOTO 4212
230 IF F=1729 IF @(12)=105 GOTO 4212
231 IF F=1513 IF @(13)=R GOTO 4213
232 IF F=1513 IF @(13)=-1 GOTO 4213
233 IF F=1513 IF @(13)=105 GOTO 4213
234 IF F=1320 IF @(14)=R GOTO 4214
235 IF F=1320 IF @(14)=-1 GOTO 4214
236 IF F=1320 IF @(14)=205 GOTO 4214
237 IF F=1408 IF @(15)=R GOTO 4215
238 IF F=1408 IF @(15)=-1 GOTO 4215
239 IF F=1408 IF @(15)=205 GOTO 4215
240 IF F=1414 IF @(16)=R GOTO 4216
241 IF F=1414 IF @(16)=-1 GOTO 4216
242 IF F=1414 IF @(16)=205 GOTO 4216
243 IF F=1758 IF @(17)=R GOTO 4217
244 IF F=1758 IF @(17)=-1 GOTO 4217
245 IF F=1758 IF @(17)=205 GOTO 4217
246 IF F=1297 IF @(18)=R GOTO 4218
247 IF F=1297 IF @(18)=-1 GOTO 4218
248 IF F=1297 IF @(18)=205 GOTO 4218
249 IF F=1207 IF @(19)=R GOTO 4219
250 IF F=1207 IF @(19)=-1 GOTO 4219
251 IF F=1207 IF @(19)=205 GOTO 4219
252 IF F=1304 IF @(20)=R GOTO 4220
253 IF F=1629 IF @(21)=R GOTO 4221
254 IF F=1215 IF @(22)=R GOTO 4222
255 IF F=1549 IF @(23)=R GOTO 4223
256 IF F=1324 IF @(24)=R GOTO 4224
257 IF F=1313 IF @(25)=R GOTO 4225
258 IF F=1086 IF @(26)=R GOTO 4226
259 IF F=1407 IF @(27)=R GOTO 4227
260 IF F=1504 IF @(28)=R GOTO 4228
261 IF F=1644 IF @(29)=R GOTO 4229
262 IF F=1531 IF @(30)=R GOTO 4230
263 IF F=1644 IF @(31)=R GOTO 4231
264 IF F=1410 IF @(32)=R GOTO 4232
270 IF F=1121 IF @(1)=-1 IF L=0 L=1:PRINT "The lantern is now on.":GOTO 23
271 IF F=1121 IF @(1)=-1 IF L=1 PRINT "The lantern is already on.":GOTO 23
272 IF F=689 IF @(2)=-1 PRINT "No good by itself.":GOTO 23
273 IF F=803 IF @(3)=-1 IF R=18 R=14:PRINT "You use rope...":GOTO 21
274 IF F=694 IF @(4)=-1 IF R=42 R=43:PRINT "Click! You walk inside...":GOTO 21
275 IF F=1015 IF @(5)=-1 IF R=29 H=H+10:PRINT "You fill the bottle with water.":PRINT "You drink it. Ahhhhhhh!":GOTO 23
276 IF F=113 PRINT "Thanks for playing!":STOP
277 IF F=425 GOTO 4300
278 IF F=540 GOTO 4400
280 IF F=1124 IF R=3 IF @(20)=R N=1:GOTO 5000
281 IF F=692 IF R=3 IF @(20)=R N=2:GOTO 5000
282 IF F=806 IF R=3 IF @(20)=R N=3:GOTO 5000
283 IF F=697 IF R=3 IF @(20)=R N=4:GOTO 5000
284 IF F=1018 IF R=3 IF @(20)=R N=5:GOTO 5000
285 IF F=986 IF R=3 IF @(20)=R N=6:GOTO 5000
286 IF F=927 IF R=3 IF @(20)=R N=7:GOTO 5000
287 IF F=686 IF R=3 IF @(20)=R N=8:GOTO 5000
288 IF F=1228 IF R=3 IF @(20)=R N=9:GOTO 5000
289 IF F=1359 IF R=3 IF @(20)=R N=10:GOTO 5000
290 IF F=1447 IF R=3 IF @(20)=R N=11:GOTO 5000
291 IF F=1322 IF R=3 IF @(20)=R N=12:GOTO 5000
292 IF F=1106 IF R=3 IF @(20)=R N=13:GOTO 5000
293 IF F=913 IF R=3 IF @(20)=R N=14:GOTO 5000
294 IF F=1001 IF R=3 IF @(20)=R N=15:GOTO 5000
295 IF F=1007 IF R=3 IF @(20)=R N=16:GOTO 5000
296 IF F=1351 IF R=3 IF @(20)=R N=17:GOTO 5000
297 IF F=890 IF R=3 IF @(20)=R N=18:GOTO 5000
298 IF F=800 IF R=3 IF @(20)=R N=19:GOTO 5000
301 IF F=1220 IF R=3 IF @(20)=R IF @(1)=-1 @(1)=99:G=G+6:GOTO 5100
302 IF F=788 IF R=3 IF @(20)=R IF @(2)=-1 @(2)=99:G=G+3:GOTO 5100
303 IF F=902 IF R=3 IF @(20)=R IF @(3)=-1 @(3)=99:G=G+5:GOTO 5100
304 IF F=793 IF R=3 IF @(20)=R IF @(4)=-1 @(4)=99:G=G+2:GOTO 5100
305 IF F=1114 IF R=3 IF @(20)=R IF @(5)=-1 @(5)=99:G=G+2:GOTO 5100
306 IF F=1082 IF R=3 IF @(20)=R IF @(6)=-1 @(6)=99:G=G+14:GOTO 5100
307 IF F=1023 IF R=3 IF @(20)=R IF @(7)=-1 @(7)=99:G=G+37:GOTO 5100
308 IF F=782 IF R=3 IF @(20)=R IF @(8)=-1 @(8)=99:G=G+60:GOTO 5100
309 IF F=1324 IF R=3 IF @(20)=R IF @(9)=-1 @(9)=99:G=G+75:GOTO 5100
310 IF F=1455 IF R=3 IF @(20)=R IF @(10)=-1 @(10)=99:G=G+142:GOTO 5100
311 IF F=1543 IF R=3 IF @(20)=R IF @(11)=-1 @(11)=99:G=G+156:GOTO 5100
312 IF F=1418 IF R=3 IF @(20)=R IF @(12)=-1 @(12)=99:G=G+240:GOTO 5100
313 IF F=1202 IF R=3 IF @(20)=R IF @(13)=-1 @(13)=99:G=G+52:GOTO 5100
314 IF F=1009 IF R=3 IF @(20)=R IF @(14)=-1 @(14)=99:G=G+40:GOTO 5100
315 IF F=1097 IF R=3 IF @(20)=R IF @(15)=-1 @(15)=99:G=G+58:GOTO 5100
316 IF F=1103 IF R=3 IF @(20)=R IF @(16)=-1 @(16)=99:G=G+36:GOTO 5100
317 IF F=1447 IF R=3 IF @(20)=R IF @(17)=-1 @(17)=99:G=G+126:GOTO 5100
318 IF F=986 IF R=3 IF @(20)=R IF @(18)=-1 @(18)=99:G=G+30:GOTO 5100
319 IF F=896 IF R=3 IF @(20)=R IF @(19)=-1 @(19)=99:G=G+24:GOTO 5100
320 IF F=444 IF R=3 IF @(20)<>R PRINT "The clerk isn't here.":GOTO 23
321 IF F=444 IF R=3 IF @(20)=R GOTO 5200
420 IF F=989 IF @(20)=R N=20:GOTO 5500
421 IF F=1314 IF @(21)=R N=21:GOTO 5500
422 IF F=900 IF @(22)=R N=22:GOTO 5500
423 IF F=1234 IF @(23)=R N=23:GOTO 5500
424 IF F=1009 IF @(24)=R N=24:GOTO 5500
425 IF F=1095 IF @(25)=R N=25:GOTO 5500
426 IF F=771 IF @(26)=R N=26:GOTO 5500
427 IF F=1092 IF @(27)=R N=27:GOTO 5500
428 IF F=1189 IF @(28)=R N=28:GOTO 5500
429 IF F=1329 IF @(29)=R N=29:GOTO 5500
430 IF F=1216 IF @(30)=R N=30:GOTO 5500
431 IF F=1329 IF @(31)=R N=31:GOTO 5500
432 IF F=1095 IF @(32)=R N=32:GOTO 5500
950 IF F=555+246 PRINT "Use abbrev.":GOTO 23
951 IF F=563+246 PRINT "Use abbrev.":GOTO 23
952 IF F=429+246 PRINT "Use abbrev.":GOTO 23
953 IF F=451+246 PRINT "Use abbrev.":GOTO 23
954 IF F=229+246 PRINT "Use abbrev.":GOTO 23
955 IF F=440+246 PRINT "Use abbrev.":GOTO 23
998 COLOR 15,1:PRINT "What?":GOTO 23
999 STOP
1997 IF R=46 IF N=6 IF L=0 PRINT "You need the lantern! It's much too dark!":GOTO 23
1998 IF R=42 IF N=1 IF L=0 PRINT "It's too dark to move in that direction!":GOTO 23
1999 IF R=8 IF N=2 IF L=0 PRINT "It's too dark to move in that direction!":GOTO 23
2000 IF R<>1 GOTO 2006
2001 IF N=2 R=5
2002 IF N=5 R=2
2003 GOTO 21
2006 IF R<>2 GOTO 2012
2007 IF N=3 R=4
2008 IF N=6 R=1
2009 GOTO 21
2012 IF R<>3 GOTO 2018
2013 IF N=4 R=5
2014 GOTO 21
2018 IF R<>4 GOTO 2024
2019 IF N=4 R=2
2020 GOTO 21
2024 IF R<>5 GOTO 2030
2025 IF N=1 R=1
2026 IF N=2 R=8
2027 IF N=3 R=3
2028 IF N=4 R=6
2029 GOTO 21
2030 IF R<>6 GOTO 2036
2031 IF N=1 R=7
2032 IF N=3 R=5
2033 IF N=4 R=39
2034 GOTO 21
2036 IF R<>7 GOTO 2042
2037 IF N=2 R=6
2038 GOTO 21
2042 IF R<>8 GOTO 2048
2043 IF N=1 R=5
2044 IF N=2 R=11
2045 IF N=3 R=9
2046 IF N=4 R=10
2047 GOTO 21
2048 IF R<>9 GOTO 2054
2049 IF N=4 R=8
2050 GOTO 21
2054 IF R<>10 GOTO 2060
2055 IF N=3 R=8
2056 GOTO 21
2060 IF R<>11 GOTO 2066
2061 IF N=1 R=8
2062 IF N=2 R=17
2063 IF N=3 R=12
2064 GOTO 21
2066 IF R<>12 GOTO 2072
2068 IF N=4 R=11
2069 GOTO 21
2072 IF R<>13 GOTO 2078
2073 IF N=2 R=16
2074 GOTO 21
2078 IF R<>14 GOTO 2084
2079 IF N=3 R=15
2080 IF N=6 R=18
2081 GOTO 21
2084 IF R<>15 GOTO 2090
2085 IF N=4 R=14
2086 GOTO 21
2090 IF R<>16 GOTO 2096
2091 IF N=1 R=13
2092 IF N=2 R=19
2093 GOTO 21
2096 IF R<>17 GOTO 2102
2097 IF N=1 R=11
2098 IF N=2 R=20
2099 GOTO 21
2102 IF R<>18 GOTO 2108
2103 IF N=2 R=21
2104 GOTO 21
2108 IF R<>19 GOTO 2114
2109 IF N=1 R=16
2110 IF N=2 R=23
2111 GOTO 21
2114 IF R<>20 GOTO 2120
2115 IF N=1 R=17
2116 IF N=2 R=26
2117 GOTO 21
2120 IF R<>21 GOTO 2126
2121 IF N=1 R=18
2122 IF N=2 R=27
2123 GOTO 21
2126 IF R<>22 GOTO 2132
2127 IF N=2 R=28
2128 GOTO 21
2132 IF R<>23 GOTO 2138
2133 IF N=1 R=19
2134 IF N=3 R=24
2135 GOTO 21
2138 IF R<>24 GOTO 2144
2139 IF N=3 R=25
2140 IF N=4 R=23
2141 GOTO 21
2144 IF R<>25 GOTO 2150
2145 IF N=3 R=26
2146 IF N=4 R=24
2147 GOTO 21
2150 IF R<>26 GOTO 2156
2151 IF N=1 R=20
2152 IF N=2 R=35
2153 IF N=3 R=27
2154 IF N=4 R=25
2155 GOTO 21
2156 IF R<>27 GOTO 2162
2157 IF N=3 R=28
2158 IF N=4 R=26
2159 IF N=1 R=21
2160 GOTO 21
2162 IF R<>28 GOTO 2168
2163 IF N=1 R=22
2164 IF N=3 R=29
2165 IF N=4 R=27
2166 GOTO 21
2168 IF R<>29 GOTO 2174
2169 IF N=4 R=28
2170 GOTO 21
2174 IF R<>30 GOTO 2180
2175 IF N=2 R=34
2176 GOTO 21
2180 IF R<>31 GOTO 2186
2181 IF N=2 R=36
2182 GOTO 21
2186 IF R<>32 GOTO 2192
2187 IF N=2 R=37
2188 GOTO 21
2192 IF R<>33 GOTO 2198
2193 IF N=3 R=34
2194 GOTO 21
2198 IF R<>34 GOTO 2204
2199 IF N=1 R=30
2200 IF N=3 R=35
2201 IF N=4 R=33
2202 GOTO 21
2204 IF R<>35 GOTO 2210
2205 IF N=1 R=26
2206 IF N=3 R=36
2207 IF N=4 R=34
2208 GOTO 21
2210 IF R<>36 GOTO 2216
2211 IF N=1 R=31
2212 IF N=3 R=37
2213 IF N=4 R=35
2214 GOTO 21
2216 IF R<>37 GOTO 2222
2217 IF N=1 R=32
2218 IF N=3 R=38
2219 IF N=4 R=36
2220 GOTO 21
2222 IF R<>38 GOTO 2228
2223 IF N=4 R=37
2224 GOTO 21
2228 IF R<>39 GOTO 2234
2229 IF N=3 R=6
2230 IF N=4 R=40
2231 GOTO 21
2234 IF R<>40 GOTO 2240
2235 IF N=3 R=39
2236 IF N=4 R=41
2237 GOTO 21
2240 IF R<>41 GOTO 2246
2241 IF N=3 R=40
2242 IF N=4 R=42
2243 GOTO 21
2246 IF R<>42 GOTO 2252
2247 IF N=1 IF @(4)<>-1 PRINT "The door is locked. You need to find a key.":GOTO 23
2248 IF N=1 IF @(23)=R COLOR 12,1:PRINT "The warrior stops you.":COLOR 15,1:PRINT "He says,'";:COLOR 11,1:PRINT"You may not pass here!";:COLOR 15,1:PRINT"'":GOTO 23
2249 IF N=1 R=43
2250 IF N=3 R=41
2251 GOTO 21
2252 IF R<>43 GOTO 2258
2253 IF N=1 R=44
2254 IF N=2 R=42
2255 GOTO 21
2258 IF R<>44 GOTO 2264
2259 IF N=1 R=45
2260 IF N=2 R=43
2261 IF N=4 R=46
2262 GOTO 21
2264 IF R<>45 GOTO 2270
2265 IF N=2 R=44
2266 GOTO 21
2270 IF R<>46 GOTO 2276
2271 IF N=3 R=44
2272 IF N=6 R=47:COLOR 7,1:PRINT "You descend the staircase...":COLOR 15,1
2273 GOTO 21
2276 IF R<>47 GOTO 2282
2277 IF N=5 R=46:COLOR 7,1:PRINT "You ascend the staircase...":COLOR 15,1
2278 GOTO 21
2282 COLOR 15,1:PRINT "What?":GOTO 23
3000 PRINT "You are standing in a tavern. A staircase heads"
3001 PRINT "upstairs to the second floor. The only exit is south."
3002 GOSUB 4500:PRINT "south, up.":GOTO 22
3003 PRINT "You are standing on the second floor in an"
3004 PRINT "upstairs hallway. A small room lies to the east."
3005 GOSUB 4500:PRINT "east,west, down.":GOTO 22
3006 PRINT "You are standing in a small shop. Commands here"
3007 PRINT "include 'buy ','sell ' and 'list'."
3008 GOSUB 4500:PRINT "west.":GOTO 22
3009 PRINT "You are standing in a small room. There isn't much"
3010 PRINT "here save for a small bed. It looks comfortable."
3011 GOSUB 4500:PRINT "west.":GOTO 22
3012 PRINT "You are walking on a path through the village. A shop"
3013 PRINT "lies to the east. The path continues west."
3014 GOSUB 4500:PRINT "north, south, east, west.":GOTO 22
3015 PRINT "You are walking on an east-west path heading out"
3016 PRINT "of town. There is a small barn to the north."
3017 GOSUB 4500:PRINT "north, east.":GOTO 22
3018 PRINT "You are standing in a small barn. It is mostly"
3019 PRINT "empty (except for some bails of hay)."
3020 GOSUB 4500:PRINT "south.":GOTO 22
3021 PRINT "You are standing before a small artisan well."
3022 PRINT "The sides of the wall are covered in moss."
3023 GOSUB 4500:PRINT "north, south, east, west.":GOTO 22
3024 PRINT "You are standing in a small cathedral. There are"
3025 PRINT "several rows of empty pews here. An altar is north."
3026 GOSUB 4500:PRINT "west.":GOTO 22
3027 PRINT "You are standing in a small guild room. A fireplace"
3028 PRINT "is set into the back wall. Above it rests a mantle."
3029 GOSUB 4500:PRINT "east.":GOTO 22
3030 PRINT "You are on a path just south of a small village."
3031 PRINT "The path continues south. You notice a house to the east."
3032 GOSUB 4500:PRINT "north, south, east.":GOTO 22
3033 PRINT "You are standing inside a small house. It is neatly"
3034 PRINT "furnished. Someone obviously lives here."
3035 GOSUB 4500:PRINT "north, west.":GOTO 22
3036 PRINT "You are standing before a bronze statue."
3037 PRINT "It appears to bare the likeness of King Elrond."
3038 GOSUB 4500:PRINT "south.":GOTO 22
3039 PRINT "You are standing on a branch high atop the forest."
3040 PRINT "To the east, near the tree center, lies a small hut."
3041 GOSUB 4500:PRINT "east, down.":GOTO 22
3042 PRINT "You are standing inside a small grassroof hut."
3043 PRINT "There isn't much here at the moment. A table rests nearby."
3044 GOSUB 4500:PRINT "west.":GOTO 22
3045 PRINT "You are walking on a narrow path north of a small bridge."
3046 PRINT "The path heads north here towards a bronze statue."
3047 GOSUB 4500:PRINT "north, south.":GOTO 22
3048 PRINT "You are walking on a well-lit path. To the south lies"
3049 PRINT "a dark forest. You notice a tree in the distance to the east."
3050 GOSUB 4500:PRINT "north, south.":GOTO 22
3051 PRINT "You are facing a large oak tree. Low-lying branches extend"
3052 PRINT "some 8 feet above the ground. Some of them twist downward."
3053 GOSUB 4500:PRINT "south.":GOTO 22
3054 PRINT "You are standing on a stone bridge. The sides are covered"
3055 PRINT "with hanging vines. A road lies to the south."
3056 GOSUB 4500:PRINT "north, south.":GOTO 22
3057 PRINT "You are walking in a well-lit forest. The undergrowth becomes"
3058 PRINT "thicker to the south. Trees block passage to the west."
3059 GOSUB 4500:PRINT "north, south.":GOTO 22
3060 PRINT "You are walking in a well-lit forest. To the north stands"
3061 PRINT "a large oak tree. The branches appear to be aged and twisted."
3062 GOSUB 4500:PRINT "north, south.":GOTO 22
3063 PRINT "You are standing in a small cottage. It is mostly bare"
3064 PRINT "save for a small bed. The only exit is back south."
3065 GOSUB 4500:PRINT "south.":GOTO 22
3066 PRINT "You are walking on a worn path west of the forest."
3067 PRINT "To the stone stands an impressive stone bridge."
3068 GOSUB 4500:PRINT "north, east.":GOTO 22
3069 PRINT "You are walking on a worn path. It heads east and west"
3070 PRINT "across the landscape. You notice a turn up ahead to the west."
3071 GOSUB 4500:PRINT "east, west.":GOTO 22
3072 PRINT "You have reached a narrow, worn path west of the forest."
3073 PRINT "It heads west towards a large stone bridge."
3074 GOSUB 4500:PRINT "east, west.":GOTO 22
3075 PRINT "You are walking in a well-lit forest. The area is plentiful"
3076 PRINT "with wildlife. To the west, the forest thins out somewhat."
3077 GOSUB 4500:PRINT "north, south, east, west.":GOTO 22
3078 PRINT "You are walking in a well-lit forest. To the east stands"
3079 PRINT "a small clearing. You notice a lake just beyond it."
3080 GOSUB 4500:PRINT "north, east, west.":GOTO 22
3081 PRINT "You are standing in a small clearing. The air is fresh here"
3082 PRINT "as the clouds roll by in the near distance. A lake is east."
3083 GOSUB 4500:PRINT "north, east, west.":GOTO 22
3084 PRINT "You are standing before a small lake. The water is murky"
3085 PRINT "and green. Light dances off the lake as the sun fades."
3086 GOSUB 4500:PRINT "west.":GOTO 22
3087 PRINT "You have reached a dead end in the green valley. Mountains"
3088 PRINT "to the north and west restrict passage in either direction."
3089 GOSUB 4500:PRINT "south.":GOTO 22
3090 PRINT "You are standing on a grassy hillside overlooking a green"
3091 PRINT "valley below. The hill slopes down to the south near a plain."
3092 GOSUB 4500:PRINT "south.":GOTO 22
3093 PRINT "You are standing at the base of a grassy hill. You notice a"
3094 PRINT "forest to the north, just beside a small clearing."
3095 GOSUB 4500:PRINT "south.":GOTO 22
3096 PRINT "You are walking in a lush, green valley. The grass tickles"
3097 PRINT "your feet as you move through the field."
3098 GOSUB 4500:PRINT "east.":GOTO 22
3099 PRINT "You are walking in a grassy plain. To the east stands a"
3100 PRINT "dark forest, shrouded by trees and canopy."
3101 GOSUB 4500:PRINT "north, east, west.":GOTO 22
3102 PRINT "You are standing in a dark forest. There is very little"
3103 PRINT "light here. To the south, the trees become dark and oppressive."
3104 GOSUB 4500:PRINT "north, east, west.":GOTO 22
3105 PRINT "You are walking in a grassy field. The grass is quite tall"
3106 PRINT "here and it tickles your ankles. A hillside is directly north."
3107 GOSUB 4500:PRINT "north, east, west.":GOTO 22
3108 PRINT "You are walking in a grassy plain. The sky is a deep blue"
3109 PRINT "here, as the clouds roll on by in the near distance."
3110 GOSUB 4500:PRINT "north, east, west.":GOTO 22
3111 PRINT "You have reached the eastern limit of this grassy plain."
3112 PRINT "Further travel east is restricted by purple mountains."
3113 GOSUB 4500:PRINT "west.":GOTO 22
3114 PRINT "You are walking on a path that heads east and west."
3115 PRINT "Far to the west, beyond some mountains, lies a hulking castle."
3116 GOSUB 4500:PRINT "east, west.":GOTO 22
3117 PRINT "You are walking on an east-west path near the village."
3118 PRINT "The path continues east and west from here."
3119 GOSUB 4500:PRINT "east, west.":GOTO 22
3120 PRINT "You are walking on a dusty path. It slopes down towards"
3121 PRINT "the west near a large stone castle. It looks ages old."
3122 GOSUB 4500:PRINT "east, west.":GOTO 22
3123 PRINT "You are facing a large, stone castle just beyond the path."
3124 PRINT "The drawbridge is up. It is normally guarded."
3125 GOSUB 4500:PRINT "north, east.":GOTO 22
3126 PRINT "You are walking in the main hallway of this castle."
3127 PRINT "The hallway heads north into a throne room."
3128 GOSUB 4500:PRINT "north, south.":GOTO 22
3129 PRINT "You are walking down a long hallway in the castle."
3130 PRINT "You notice a small library to the west."
3131 GOSUB 4500:PRINT "north, south, west.":GOTO 22
3132 PRINT "You are facing a golden throne in the castle."
3133 PRINT "The king is usually sitting here, awaiting the end."
3134 GOSUB 4500:PRINT "south.":GOTO 22
3135 PRINT "You are standing in the castle library."
3136 PRINT "The shelves are completely empty of any books."
3137 GOSUB 4500:PRINT "east, down.":GOTO 22
3138 PRINT "You are standing in the vampire's lair. You notice a large"
3139 PRINT "coffin atop a raised platform. It is open."
3140 GOSUB 4500:PRINT "up.":GOTO 22
3500 IF R=1 GOTO 3000
3501 IF R=2 GOTO 3003
3502 IF R=3 GOTO 3006
3503 IF R=4 GOTO 3009
3504 IF R=5 GOTO 3012
3505 IF R=6 GOTO 3015
3506 IF R=7 GOTO 3018
3507 IF R=8 GOTO 3021
3508 IF R=9 GOTO 3024
3509 IF R=10 GOTO 3027
3510 IF R=11 GOTO 3030
3511 IF R=12 GOTO 3033
3512 IF R=13 GOTO 3036
3513 IF R=14 GOTO 3039
3514 IF R=15 GOTO 3042
3515 IF R=16 GOTO 3045
3516 IF R=17 GOTO 3048
3517 IF R=18 GOTO 3051
3518 IF R=19 GOTO 3054
3519 IF R=20 GOTO 3057
3520 IF R=21 GOTO 3060
3521 IF R=22 GOTO 3063
3522 IF R=23 GOTO 3066
3523 IF R=24 GOTO 3069
3524 IF R=25 GOTO 3072
3525 IF R=26 GOTO 3075
3526 IF R=27 GOTO 3078
3527 IF R=28 GOTO 3081
3528 IF R=29 GOTO 3084
3529 IF R=30 GOTO 3087
3530 IF R=31 GOTO 3090
3531 IF R=32 GOTO 3093
3532 IF R=33 GOTO 3096
3533 IF R=34 GOTO 3099
3534 IF R=35 GOTO 3102
3535 IF R=36 GOTO 3105
3536 IF R=37 GOTO 3108
3537 IF R=38 GOTO 3111
3538 IF R=39 GOTO 3114
3539 IF R=40 GOTO 3117
3540 IF R=41 GOTO 3120
3541 IF R=42 GOTO 3123
3542 IF R=43 GOTO 3126
3543 IF R=44 GOTO 3129
3544 IF R=45 GOTO 3132
3545 IF R=46 GOTO 3135
3546 IF R=47 GOTO 3138
3599 GOTO 22
3800 COLOR 15,1:IF @(1)=R PRINT "lantern"
3802 IF @(2)=R PRINT "oil"
3803 IF @(3)=R PRINT "rope"
3804 IF @(4)=R PRINT "key"
3805 IF @(5)=R PRINT "bottle"
3806 IF @(6)=R PRINT "dagger"
3807 IF @(7)=R PRINT "sword"
3808 IF @(8)=R PRINT "axe"
3809 IF @(9)=R PRINT "scimitar"
3810 IF @(10)=R PRINT "longsword"
3811 IF @(11)=R PRINT "broadsword"
3812 IF @(12)=R PRINT "battleaxe"
3813 IF @(13)=R PRINT "cleaver"
3814 IF @(14)=R PRINT "armor"
3815 IF @(15)=R PRINT "shield"
3816 IF @(16)=R PRINT "helmet"
3817 IF @(17)=R PRINT "gauntlets"
3818 IF @(18)=R PRINT "cloak"
3819 IF @(19)=R PRINT "ring"
3820 COLOR 12,1:IF @(20)=R PRINT "clerk"
3821 IF @(21)=R PRINT "villager"
3822 IF @(22)=R PRINT "wolf"
3823 IF @(23)=R PRINT "warrior"
3824 IF @(24)=R PRINT "ghost"
3825 IF @(25)=R PRINT "goblin"
3826 IF @(26)=R PRINT "elf"
3827 IF @(27)=R PRINT "hobbit"
3828 IF @(28)=R PRINT "paladin"
3829 IF @(29)=R PRINT "skeleton"
3830 IF @(30)=R PRINT "vampire"
3831 IF @(31)=R PRINT "sorcerer"
3832 IF @(32)=R PRINT "dragon"
3833 IF A=0 GOTO 23
3834 COLOR 11,1:IF @(6)=105 PRINT "dagger ";:COLOR 12,1:PRINT "(wielded)"
3835 COLOR 11,1:IF @(7)=105 PRINT "sword ";:COLOR 12,1:PRINT "(wielded)"
3836 COLOR 11,1:IF @(8)=105 PRINT "axe ";:COLOR 12,1:PRINT "(wielded)"
3837 COLOR 11,1:IF @(9)=105 PRINT "scimitar ";:COLOR 12,1:PRINT "(wielded)"
3838 COLOR 11,1:IF @(10)=105 PRINT "longsword ";:COLOR 12,1:PRINT "(wielded)"
3839 COLOR 11,1:IF @(11)=105 PRINT "broadsword ";:COLOR 12,1:PRINT "(wielded)"
3840 COLOR 11,1:IF @(12)=105 PRINT "battleaxe ";:COLOR 12,1:PRINT "(wielded)"
3841 COLOR 11,1:IF @(13)=105 PRINT "cleaver ";:COLOR 12,1:PRINT "(wielded)"
3842 COLOR 10,1:IF @(14)=205 PRINT "armor ";:COLOR 13,1:PRINT "(worn)"
3843 COLOR 10,1:IF @(15)=205 PRINT "shield ";:COLOR 13,1:PRINT "(worn)"
3844 COLOR 10,1:IF @(16)=205 PRINT "helmet ";:COLOR 13,1:PRINT "(worn)"
3845 COLOR 10,1:IF @(17)=205 PRINT "gauntlets ";:COLOR 13,1:PRINT "(worn)"
3846 COLOR 10,1:IF @(18)=205 PRINT "cloak ";:COLOR 13,1:PRINT "(worn)"
3847 COLOR 10,1:IF @(19)=205 PRINT "ring ";:COLOR 13,1:PRINT "(worn)"
3850 IF F=105 R=O
3851 IF F=1006 R=O
3852 IF F=105 GOTO 23
3853 IF F=1006 GOTO 23
3860 GOTO 23
3900 FOR X=1 TO 19:IF @(X)=105 @(X)=-1
3901 NEXT:IF S>0 @(S)=105:PRINT "Wielded."
3902 S=0:GOTO 23
4201 COLOR 7,1:PRINT "lantern: A brass lantern with rusted hinges.":GOTO 23
4202 COLOR 7,1:PRINT "oil: A small flask of oil.":GOTO 23
4203 COLOR 7,1:PRINT "rope: A coil of rope about 20 feet in length.":GOTO 23
4204 COLOR 7,1:PRINT "key: A small wooden key.":GOTO 23
4205 COLOR 7,1:PRINT "bottle: A smokey glass bottle.":GOTO 23
4206 COLOR 7,1:PRINT "dagger: A small metal dagger.":GOTO 23
4207 COLOR 7,1:PRINT "sword: A long metal sword. It has a ruby hilt.":GOTO 23
4208 COLOR 7,1:PRINT "axe: A full metal axe with a wrapped hilt.":GOTO 23
4209 COLOR 7,1:PRINT "scimitar: A gleaming metal scimitar.":GOTO 23
4210 COLOR 7,1:PRINT "longsword: A metal longsword with an opaque hilt.":GOTO 23
4211 COLOR 7,1:PRINT "broadsword: A full metal broadsword. It has a diamond hilt.":GOTO 23
4212 COLOR 7,1:PRINT "battleaxe: A metal battleaxe. It exudes power!":GOTO 23
4213 COLOR 7,1:PRINT "cleaver: A common meat cleaver. Used to chop up steak.":GOTO 23
4214 COLOR 7,1:PRINT "armor: A suit of chainlinked metal armor.":GOTO 23
4215 COLOR 7,1:PRINT "shield: A crusader shield. It is stained with blood.":GOTO 23
4216 COLOR 7,1:PRINT "helmet: A brass helmet.":GOTO 23
4217 COLOR 7,1:PRINT "gauntlets: Full metal gauntlets to protect the hands.":GOTO 23
4218 COLOR 7,1:PRINT "cloak: An elven cloak. It is brown with a rope tied at the waist.":GOTO 23
4219 COLOR 7,1:PRINT "ring: A magical ring of protection. It glows with a bluish hue.":GOTO 23
4220 COLOR 7,1:PRINT "clerk: A stout clerk. He looks well-fed.":GOTO 23
4221 COLOR 7,1:PRINT "villager: A common villager. He smiles at you briefly before passing.":GOTO 23
4222 COLOR 7,1:PRINT "wolf: A wolf from the surrounding forest. He seems content on watching you.":GOTO 23
4223 COLOR 7,1:PRINT "warrior: A strong warrior with flowing hair and a trimmed beard.":GOTO 23
4224 COLOR 7,1:PRINT "ghost: A translucent ghost. It haunts any abode it can find.":GOTO 23
4225 COLOR 7,1:PRINT "goblin: This hideous beast has yellow teeth and an ugly grin.":GOTO 23
4226 COLOR 7,1:PRINT "elf: An elf of the surrounding forest.":GOTO 23
4227 COLOR 7,1:PRINT "hobbit: A small hobbit with furry feet.":GOTO 23
4228 COLOR 7,1:PRINT "paladin: A strong paladin with metal armor. He seems mean.":GOTO 23
4229 COLOR 7,1:PRINT "skeleton: A skeleton stained with blood. It looks undead.":GOTO 23
4230 COLOR 7,1:PRINT "vampire: A deadly vampire. It cannot stand the sunlight.":GOTO 23
4231 COLOR 7,1:PRINT "sorcerer: An evil sorcerer with a magical spellbook. He looks very mean.":GOTO 23
4232 COLOR 7,1:PRINT "dragon: A large, winged dragon. It appears to be the last of her species.":GOTO 23
4233 GOTO 23
4300 COLOR 7,1:PRINT "HELP":PRINT:COLOR 15,1:PRINT "This game is a text adventure. You enter verb-noun word":PRINT "combinations such as the following:":PRINT
4301 COLOR 11,1:PRINT "get sword":PRINT:COLOR 15,1:PRINT "If the sword is in the room, the player will then pick it up.":PRINT:COLOR 7,1:PRINT "COMMANDS":PRINT
4302 COLOR 15,1:PRINT "Commands for the game include the following:":PRINT:COLOR 7,1:PRINT "go,get,drop,wield,unwield,wear,remove,use,examine,buy,sell,inventory (or i),"
4303 PRINT "score,kill,quit.":PRINT:COLOR 15,1:GOTO 23
4400 COLOR 15,1:PRINT "You have ";:COLOR 7,1:PRINT H;:COLOR 15,1:PRINT " hit points.":PRINT "You have ";:COLOR 7,1:PRINT G;:COLOR 15,1:PRINT " gold coins."
4401 PRINT "You also have ";:COLOR 7,1:PRINT E;:COLOR 15,1:PRINT " experience points."
4402 GOTO 23
4499 STOP
4500 COLOR 15,1:PRINT "Obvious exits: ";:COLOR 14,1:RETURN
5000 P=0:IF N=1 P=12
5002 IF N=2 P=6
5003 IF N=3 P=10
5004 IF N=4 P=5
5005 IF N=5 P=4
5006 IF N=6 P=28
5007 IF N=7 P=75
5008 IF N=8 P=120
5009 IF N=9 P=156
5010 IF N=10 P=284
5011 IF N=11 P=312
5012 IF N=12 P=480
5013 IF N=13 P=105
5014 IF N=14 P=80
5015 IF N=15 P=116
5016 IF N=16 P=72
5017 IF N=17 P=240
5018 IF N=18 P=60
5019 IF N=19 P=48
5020 IF @(N)=99 IF G>P-1 G=G-P:@(N)=-1:COLOR 11,1:PRINT "Purchased. The clerk says,'Thank you for your business.'":GOTO 23
5021 IF @(N)=99 PRINT "The clerk says,'You can't afford that.'":COLOR 11,1:PRINT "Cost: ";:PRINT P:COLOR 15,1:PRINT "Gold: ";:COLOR 7,1:PRINT G:COLOR 15,1:GOTO 23
5022 PRINT "The clerk says,'I don't sell that here.'":GOTO 23
5100 PRINT "The clerk says,'Thank you.'":GOTO 23
5200 COLOR 15,1:PRINT "The clerk says,'Here is what we have right now:'"
5201 COLOR 7,1:IF @(1)=99 PRINT "lantern: 12"
5202 IF @(2)=99 PRINT "oil: 6"
5203 IF @(3)=99 PRINT "rope: 10"
5204 IF @(4)=99 PRINT "key: 5"
5205 IF @(5)=99 PRINT "bottle: 4"
5206 IF @(6)=99 PRINT "dagger: 28"
5207 IF @(7)=99 PRINT "sword: 75"
5208 IF @(8)=99 PRINT "axe: 120"
5209 IF @(9)=99 PRINT "scimitar: 156"
5210 IF @(10)=99 PRINT "longsword: 284"
5211 IF @(11)=99 PRINT "broadsword: 312"
5212 IF @(12)=99 PRINT "battleaxe: 480"
5213 IF @(13)=99 PRINT "cleaver: 105"
5214 IF @(14)=99 PRINT "armor: 80"
5215 IF @(15)=99 PRINT "shield: 116"
5216 IF @(16)=99 PRINT "helmet: 72"
5217 IF @(17)=99 PRINT "gauntlets: 240"
5218 IF @(18)=99 PRINT "cloak: 60"
5219 IF @(19)=99 PRINT "ring: 48"
5250 COLOR 11,1:PRINT "Gold: ";:PRINT G
5251 COLOR 15,1:PRINT "The clerk says,'Take your time.'":GOTO 23
5500 M=RND(150):M=M+50:IF N>27 M=RND(1200):M=M+300
5501 A=1:IF @(14)=205 A=A+14
5502 IF @(15)=205 A=A+15
5503 IF @(16)=205 A=A+8
5504 IF @(17)=205 A=A+4
5505 IF @(18)=205 A=A+3
5506 IF @(19)=205 A=A+1
5507 IF @(29)=R IF N=30 COLOR 15,1:PRINT "The skeleton steps in front!":COLOR 15,1:PRINT "It hisses,'";:COLOR 12,1:PRINT "You may not attack!";:COLOR 15,1:PRINT "'":GOTO 23
5510 D=1:IF @(6)=105 D=3
5511 IF @(7)=105 D=4
5512 IF @(8)=105 D=6
5513 IF @(9)=105 D=12
5514 IF @(10)=105 D=8
5515 IF @(11)=105 D=14
5516 IF @(12)=105 D=18
5517 IF @(13)=105 D=7
5520 I=RND(25):I=I+1
5521 COLOR 10,1:PRINT "--------------------"
5522 COLOR 15,1:PRINT "You attack... "
5523 COLOR 10,1:PRINT "--------------------"
5524 COLOR 15,1:IF I<6 PRINT "Alas, you missed..."
5525 IF I>5 IF I<10 COLOR 15,1:PRINT "You hit the monster!":M=M-D
5526 IF I>5 IF I<10 IF D=14 COLOR 13,1:PRINT "Your BROADSWORD glows!":PRINT "The monster is pounded into submission!!!":M=0
5527 IF I>5 IF I<10 IF D=18 COLOR 14,1:PRINT "Your BATTLEAXE attacks!":PRINT "The monster is hit hard!!":M=M-100
5528 IF I>9 IF I<16 IF @(14)=205 COLOR 14,1:PRINT "Your ARMOR feels warm...":COLOR 7,1:PRINT "You regained partial hit points!":H=H+30
5529 IF I>9 IF I<16 IF @(15)=205 COLOR 12,1:PRINT "Your SHIELD shoots a fireball!":COLOR 15,1:PRINT "The shield says,'";:COLOR 11,1:PRINT "Take that, monster!";:COLOR 15,1:PRINT "'":M=M-25
5530 IF I>9 IF I<16 COLOR 10,1:PRINT "AMAZING blow! The monster is cut badly!":M=M-50:V=D*3:M=M-V
5531 IF I>15 IF I<20 COLOR 13,1:PRINT "CRUSHING blow! The monster is smashed into atoms!":M=1
5532 IF I>19 COLOR 15,1:PRINT "The monster dodged your attack.":IF N=30 COLOR 11,1:PRINT "The VAMPIRE sinks his teeth into you!":COLOR 12,1:PRINT "You are wounded badly!!!":H=H-250
5533 COLOR 15,1:IF M<1 PRINT "The monster died.":PRINT "You killed it.":GOTO 5560
5534 I=RND(25):I=I+1
5535 COLOR 12,1:PRINT "----------------"
5536 COLOR 7,1: PRINT "Monster attacks!"
5537 COLOR 12,1:PRINT "----------------"
5538 COLOR 15,1:IF I<6 PRINT "Whew! It missed you...":IF @(19)=205 COLOR 14,1:PRINT "Your RING pulsates!":PRINT "The monster is drained of life!":M=M-50:H=H+50
5539 IF I>5 IF I<12 PRINT "The monster hit you very hard!":H=H-75:H=H+A
5540 IF I>11 IF I<20 PRINT "Vicious hit! The monster DESTROYED you!":H=H-150:H=H+A
5541 IF I>19 COLOR 15,1:PRINT "You dodged the attack..."
5542 IF H<1 COLOR 15,1:PRINT "Alas, you have died...":COLOR 7,1:PRINT "GAME OVER":COLOR 15,1:STOP
5543 COLOR 14,1:PRINT "Press ENTER to go on..."
5544 GET X:IF X=13 GOTO 5546
5545 GOTO 5544
5546 GOTO 5501
5560 E=E+I*2:G=G+I:COLOR 11,1:PRINT "You gained ";I*2;" experience and ";I:PRINT "gold coins. You feel stronger!":H=H+I*4
5561 IF I>9 IF I<16 PRINT "You gained a level!":H=H+100:G=G+100:E=E+I*4
5562 FOR X=1 TO 19:IF @(X)=1000+N COLOR 7,1:PRINT "You found something on it!":@(X)=R
5563 NEXT:IF N=30 GOTO 5600
5564 @(N)=998:GOTO 23
5600 PRINT:COLOR 10,1:PRINT "********************"
5601 PRINT "* ";:COLOR 14,1:PRINT "Congratulations! ";:COLOR 10,1:PRINT "*"
5602 COLOR 10,1:PRINT "********************":PRINT:COLOR 15,1
5603 PRINT "The dead vampire's corpse lay at your feet. No more will the evil"
5604 PRINT "of the undead haunt the surrounding village or its people. You have"
5605 PRINT "successfully vanquished the evil vampire!":PRINT
5606 COLOR 7,1:PRINT "THE END":STOP

It has some bugs, of course, but the game functions without strings and is the first text adventure that I've ever written in a string-deficient BASIC.

The only restriction being that you cannot use Backspace to correct typing mistakes (both MINI-BASIC and Tiny BASIC lack use of an advanced, completely "alphanumeric" INPUT statement...that is, it can't read letters entered, only numbers...hence the "trick" employed in both games to simulate alphanumeric
input).

You will find that both games, although small, use clever programming tricks to get around MINI-BASIC/Tiny BASIC limitations.

And from the original message I posted:

I'm having difficulty writing a 5k text adventure game in 8086 Tiny BASIC. I was wondering if anyone had any suggestions?

I've included all of the game data, and source code thus far, below if anyone wants to see what might be done to help make this project manageable.

I know this is possible on a 3K expanded Vic-20, so why can't it work under 8086 Tiny BASIC as well?

See below:

"Tiny BASIC Adventure 5k"
By: Paul Panks

Game Map
--------
25 total rooms

2--3
|
1 7--5
| |
4--6
|
24--25 10--8--9 13--14
| | /
23 21 11--12--15
\ | |
22--20 16--18
| |
19--17


# Item Name Location Notes
---------------------------------------------
7=LANTERN ( 101) On player
8=OIL ( 5) --
9=SWORD ( 999) In Store
10=ROPE ( 3) --
11=HELMET (1022) On Ghost (1000+22)
12=SHIELD ( 22) --
13=RING (1023) On Hobbit (1000+23)
14=CLOAK (1021) On Paladin (1000+21)
15=ARMOR (1026) On Knight (1000+26)
16=BOOK ( 14) --
17=SCROLL ( 10) --
18=ORB ( 21) --
19=CLERK ( 9) --
20=VILLAGER ( 4) --
21=PALADIN ( 12) --
22=GHOST ( 11) --
23=HOBBIT ( 14) --
24=GOBLIN ( 17) --
25=WEREWOLF ( 24) --
26=KNIGHT ( 19) --
27=DRAGON ( 25) --

# Examine Command Output
------------------------------------------------------------------
7 EXAMINE LANTERN : This is a brass lantern.
8 EXAMINE OIL : A flask of oil.
9 EXAMINE SWORD : It's a strong metal sword.
10 EXAMINE ROPE : A coil of rope about 10' long.
11 EXAMINE HELMET : A brass helmet.
12 EXAMINE SHIELD : An iron shield. It has an eagle on the front.
13 EXAMINE RING : A simple iron ring.
14 EXAMINE CLOAK : A fine elven cloak.
15 EXAMINE ARMOR : Full chainlinked metal armor.
16 EXAMINE BOOK : This is an ancient book!
17 EXAMINE SCROLL : The scroll reads: 'The dragon fears the Orb.'
18 EXAMINE ORB : A mystical Orb of Light. It glows softly!
19 EXAMINE CLERK : A stout clerk. He looks well fed.
20 EXAMINE VILLAGER: A common villager.
21 EXAMINE PALADIN : A strong paladin with flowing hair.
22 EXAMINE GHOST : A harrowing specter. It appears translucent.
23 EXAMINE HOBBIT : This curious creature looks odd indeed!
24 EXAMINE GOBLIN : A hideous goblin. It snarls at you!
25 EXAMINE WEREWOLF: An evil werewolf, with reddish eyes.
26 EXAMINE KNIGHT : A strong knight. He keep watch nearby.
27 EXAMINE DRAGON : A winged creature with tough scales and powerful
claws!
------------------------------------------------------------------

Source Code thus far:

>LIST
10 PRINT
20 PRINT
30 PRINT
40 PRINT "Tiny BASIC Adventure 5k"
50 PRINT "By: Paul Panks"
60 PRINT
70 R=1
80 H=100
90 A=101
100 B=5
110 C=999
120 D=3
130 E=1022
140 F=22
150 G=1023
160 I=1021
170 J=1026
180 K=14
190 L=10
200 M=21
210 N=9
220 O=4
230 P=12
240 Q=11
250 S=14
260 T=17
270 U=24
280 V=19
290 W=25
300 IF R=1 PRINT "You are standing inside a tavern. The village is
south."
310 IF R=2 PRINT "You are facing an upstairs hallway. A room lies to
the east of here."
320 IF R=3 PRINT "You are inside a small room. There is a bed here. The
hallway is west."
330 IF R=4 PRINT "You are standing near a stone artisan well. The water
looks mossy green."
340 IF R=5 PRINT "You are standing inside the backroom of the church.
There are a few barrels visible here."
350 IF R=6 PRINT "You are standing near the back of a large church. The
altar is directly north."
360 IF R=7 PRINT "You are facing a stone altar within the church. A
storage room lies to the east of here."
370 IF R=8 PRINT "You are near the outskirts of town. The village
buildings can be seen up ahead to the north. A sign is here.
380 IF R=9 PRINT "The path you are on has been obstructed by fallen
trees. The only exit is back west."
390 IF R=10 PRINT "You are standing inside a small cottage near the
forest. It looks mostly bare save for a small fireplace."
400 IF R=11 PRINT "You are walking down a narrow path within the
forest. Trees are visible in all directions here."
410 IF R=12 PRINT "You are walking down a narrow path. A large tree is
growing beside the road nearby."
420 IF R=13 PRINT "You are standing on a branch atop the forest. A
small thatched roof hut is east of here."
430 IF R=14 PRINT "You are standing inside a small thatched roof hut.
There is a table here as wellas a bookshelf."
440 IF R=15 PRINT "You have reached a small pond near the forest. The
water looks fairly green and mossy."
450 IF R=16 PRINT "You are walking down a well-lit path within a large
forest. The path widens to the south."
460 IF R=17 PRINT "You stand before a large, hulking castle at the end
of the forest. The draw- bridge is down."
470 IF R=18 PRINT "The path ends here near a large boulder. It looks
impassable however."
480 IF R=19 PRINT "You are walking within the Main Hall of the castle.
Several corridors branch off here."
490 IF R=20 PRINT "You are walking down the main hallway of this
castle. A parlor room is directly west of here."
495 IF R=21 PRINT "You are facing the main throne room. A large throne
is here, encrusted with gold and jewels."
500 IF R=22 PRINT "You are within the main parlor room of the castle. A
piano is here, next to an open doorway."
505 IF R=23 PRINT "You are through a large doorway near the parlor. It
appears to head into dark- ness below."
506 IF R=24 PRINT "You are within the dungeon below the castle. Your
lantern illuminates several rows of cells."
507 IF R=25 PRINT "You are facing a lone cell, occupied by a frail old
man. He looks up at you with sorrowful eyes."
510 IF A=R PR."lantern"
511 IF B=R PR."oil"
512 IF C=R PR."sword"
513 IF D=R PR."rope"
514 IF E=R PR."helmet"
515 IF F=R PR."shield"
516 IF G=R PR."ring"
517 IF I=R PR."cloak"
518 IF J=R PR."armor"
519 IF K=R PR."book"
520 IF L=R PR."scroll"
521 IF M=R PR."orb"
522 IF N=R PR."clerk"
523 IF O=R PR."villager"
524 IF P=R PR."paladin"
525 IF Q=R PR."ghost"
526 IF S=R PR."hobbit"
527 IF T=R PR."goblin"
528 IF U=R PR."werewolf"
529 IF V=R PR."knight"
530 IF W=R PR."dragon"
531 @(11)=2
532 @(12)=4
533 @(22)=1
534 @(23)=3
535 @(34)=2
536 @(41)=1
537 @(42)=8
538 @(43)=6
539 @(54)=7
540 @(61)=7
541 @(72)=6
542 @(81)=4
543 @(82)=11
544 @(64)=4
545 @(83)=9
546 @(84)=10
547 @(94)=8
548 @(103)=8
549 @(111)=8
550 @(112)=16
551 @(113)=12
552 @(123)=15
553 @(124)=11
554 @(133)=14
555 @(136)=12
556 @(144)=13
557 @(154)=12
558 @(161)=11
559 @(162)=17
560 @(163)=18
561 @(171
=16
562 @(174)=19
563 @(184)=16
564 @(191)=20
565 @(193)=17
566 @(201)=21
567 @(202)=19
568 @(204)=22
569 @(212)=20
570 @(223)=20
571 @(226)=23
572 @(231)=24
573 @(235)=23
574 @(242)=23
575 @(243)=25
576 @(254)=24
577 @(604)=4

OK
>

Note: @(xxx) is attempting to simulate a normal game map array, i.e. "m(x,y)". Example: @(604)=4 is to be later parsed and equivalent to the same as "m(6,4)=4" in Microsoft BASIC. Another example: @(254)=24 should eventually be the same, when parsed properly, as "m(25,4)=24".

1=north
2=south
3=east
4=west
5=up
6=down

So: m(x,y) is actually: m(room, direction)

Stumbling Blocks
----------------

1. Too many @(I) arrays (46 or so...only 26 allowed). How will the map for the game work without an array (e.g. "m(x,y)" as in traditional BASIC )?

2. 8086 Tiny BASIC reports 1,347 bytes left (!!). I'm not even halfway through writing it!

3. No strings supported. How will the player enter in input? Can I
simulate it through USR or INP functions? In 8086 Tiny BASIC, no less?

4. Would I be better off using Tiny BASIC v3.0 or 3.1? Do any of the Tiny BASICs support strings or arrays? I've heard Minol 2.0 Tiny BASIC does, but is that available for Windows/DOS?

I'd really like to write a Tiny BASIC adventure game, but the stumbling blocks I faced when writing a MINI-BASIC version were at least manageable with Sylvain's good use of GET/INPUT emitting an ASCII CHR$ character code for each letter or number entered. Can Palo Alto Tiny BASIC or Tom Pittman's Tiny BASIC emit CHR character codes for INPUTed text?

I think, for this adventure to be workable, that Tiny BASIC needs to allow at least 8,096 basic bytes free (including the size of the Tiny BASIC interpreter).

Plus, the ability to mimic Sylvain's method of emitting ASCII CHR$
character codes for either the INPUT or GET commands. In Dark Forest II, available from my page, that's the method I used to at least simulate string input from the user:

http://www.geocities.com/dunric/dforest.html

Is this project more likely to succeed in Minol 2.0 Tiny BASIC? Or another version of Tiny BASIC with more memory and slightly altered features?

Sincerely,

Paul Allen Panks
dunric@yahoo.com

8 Comments:

Blogger Mysticman said...

Hi Paul it never ceases to amaze me how creative people are, especailly the young ones, gives me hope for the future. Anyway I was looking for information on dream book and landed on your page. I was looking more for dream book so A Tiny BASIC Adventure Game? wasn't an exact match but I enjoyed reading your posts. Take Care. I'll bookmark your blog for future.

11:05 PM  
Blogger Mysticman said...

Greetings Paul it's rather cold here today, but summer is comming to our part of the world soon. I was looking for the latest most up to date information on dream meaning and I landed on your page. Although A Tiny BASIC Adventure Game? is not an exact match I can see why I ended up here while looking for dream meaning Great stuff thanks for the read.....now where did I put that surf board !

5:08 AM  
Blogger Mysticman said...

Greetings from Down Under, no not Australia, NZ the real downunder! Hi Paul I was surfing blogs (as you do) looking for innocent dream information when I came across your site. While A Tiny BASIC Adventure Game? wasn't an exact match I enjoyed reading your posts. Thanks for the read, I'll visit again some time. take care.

7:31 AM  
Blogger Sandy said...

Congratulations Paul for the post about A Tiny BASIC Adventure Game? . I wanted to know if you can put an eye on my new site that speaks about risultati scommesse and tell me what do you think about it. If you're interested in the risultati scommesse subject you cannot find anything better!

10:31 AM  
Blogger John said...

This is a very nice post about the A Tiny BASIC Adventure Game? , Paul try to keep it up to date because it seems one of the few interesting blogs on the internet! I would like to tell you to visit my website that is about scommesse online . Only the best informations about scommesse online !

12:23 PM  
Blogger Sarah said...

Congratulations Paul for the post about A Tiny BASIC Adventure Game? . I wanted to know if you can put an eye on my new site that speaks about risultati scommesse and tell me what do you think about it. If you're interested in the risultati scommesse subject you cannot find anything better!

4:59 AM  
Blogger Rod said...

Hi there Paul, I was just browsing, looking for games related blogs and found yours. Very Nice! As a parent myself, if you have kids who love to play games online, here's a WIN WIN deal! RealArcade GamePass has a 30-Day FREE TRIAL with 350+ popular Action, Puzzle & Word games that are 100% safe and secure. No commitment, cancel anytime. Just go to free online adventure game to register and find out about more great benefits! HAVE FUN :)

6:01 PM  
Blogger Rachel said...

Nice game related blog Paul. Here's a WIN WIN deal if you have kids who love to play games online! RealArcade GamePass has a 30-Day FREE TRIAL with over 350 popular Action, Puzzle & Word games that are 100% safe and secure. There's no commitment to sign-up, they can cancel anytime. Just go to free online adventure game to register and find out about more great benefits! HAVE FUN :)

2:07 PM  

Post a Comment

<< Home

Blogarama
( Blog advertisement above )
 
Search Popdex:

Wil's Domain - Your Web search resource.

Listed on Blogwise
Free Web Counter
Counters