HP-41 Hobbit Adventure Game!

Back to main page Email me at: Gene!


This game program originally appeared in the PPC Journal V10N6P26 in July 1983 by Dejan Ristanovic (who emailed me in late June 1997). I have modified the program somewhat from its original form, by removing all tones, shortening some alpha prompts, and changing the random number generator.

Program Description: You are a hobbit thief who has entered a 10x10 maze. A Wizard lives there but is not presently at home, but if you stay too long, he will return home and eat you. Your task is to find the mighty ORB of Zot and to kill as many demons as possible. Note that finding the ORB is your primary task while killing demons is only an option to increase your score. There are the following objects hidden in the maze:

1) The ORB of Zot (which is disguised as a Warp)
2) Demons (the number of which depends on the playing level)
3) 7 Amulets
4) Spare flares
5) A lot of Warps (the number of which depends on the playing level)
6) A Staff of power (disguised as a demon)
7) Gems on all squares not otherwise occupied.

Each turn you have several options:
Pressing A = Move. You will then be asked what direction, where 8 = North, 4 = West, 2 = South, and 6 = East.
Pressing B = Fight the Demon. You can use this option only if you have an amulet to use as a weapon.
Pressing C = Teleport (only when you have the Staff)
Pressing D = Quit the game (why would you want to do that?)
Pressing E = Use a Flare to illuminate an adjoinging square (only if you have one available). You then will be asked what direction just like the move command.

How to move... The maze is a 10x10 torus. In each turn, you can go north, south, east or west. If you go north on one of the top row squares, you end up in the same column on the bottom row. Similar movement occurs if you go off any other edge. But, there are alot of WARPs in the maze. When you enter a square with a warp on it, you are automatically transferred to another square. Warps can therefore be very dangerous, since you might be transferred to a square with a demon on it. But they can also be very useful by enabling rapid transit around the maze.

How to find Amulets... When you enter a square with an amulet on it, you automatically pick it up and AMULET # is shown, with the appropriate number. The number is important, because when you use the amulet to fight a demon, the number must be entered. Enter a wrong number and you might be fighting with your bare hands!

How to kill a demon... When you reach a square with a demon hiding on it, DEMON is shown in the display. If you don't even have a single amulet to fight with, the demon can eat you unless you bribe it with some gems (probably between 5-10 should be offered- it depends on how cheap you are and how much risk you want to live (or die) with). If you have an amulet, the demon will not eat you. You can either then fight the demon or move away to another square. To attack a demon, press B. The calculator will ask which WEAPON? you want to use and you should enter a amulet number at that prompt. If you don't kill the demon, LIVED is displayed. If you kill it, GOT HIM is shown.

But watch out. Each amulet only has a certain amount of energy. Use it up and it disappears. If you are in a square with a demon when that happens, you might get eaten. If your amulet disappears, you will have no weapon to fight the next demon you encounter unless you find another amulet. How to use flares... Use a flare to see what is on an adjacent square. To use one, press E and enter the direction to throw the flare. After that, you will be shown what is on the square. Remember that DEMON can be a demon or the staff, WARP can either be a warp or the ORB, or YOUR TRACKS will be displayed indicating you've been on that square before. Your supply of flares is limited, but if you run out, another square somewhere in the maze has 8 more on it.

How to find the staff... You find the staff just by entering the square it is located on. If you use a flare on a square where the staff is located, it will show demon, but if you summon the courage to enter, you will be given the staff.

How to teleport... To teleport you must have the staff and press C and enter the position of the square you want to teleport to. Beware, you lose all gems and amulets when you teleport. If you run into a demon, you'll be highly unlucky. Therefore, use teleport only when necessary to find the ORB.

How to find the ORB of Zot?... That is not easy at all! ORB is masked as a Warp. But it is a special kind of Warp-one that does not transfer you to the same square all the time. Let's say you are on square 32 and move west to square 31. If the ORB were located there, you would just slide on through to square 30. Now if you go east to square 31 again, you slide through to square 32. The only way to get the ORB is to teleport in that case to square 31. Do so, and you've won the game!

To run the program...Size 051 and XEQ "HOB". Enter a decimal seed between 0 and 1 and press R/S. Then enter the difficulty level between 1 and 10 and press R/S. After several minutes (about 5!), the maze will be generated and you will be shown your position in the maze as a two-digit integer and prompted with "WELL?". Begin moving as described above and find the ORB before the Wizard returns! Enjoy!

Sample Game: Size 051, Press USER, XEQ "HOB", "SEED?", 0.35455565, R/S, "LEVEL?", 2, R/S. Five minutes or so later...

See            Press       Comments
POS 34
GEMS-3
WELL?           A
WHICH WAY?      8 R/S      Let's go north!
POS 24
GEMS-6
WELL?           A
WHICH WAY?      8 R/S      Keep going north!
POS 14
AMULET 3                   Good, we have a weapon!
WELL?           A
WHICH WAY?      4 R/S      Let's go west!
POS 13
GEMS-10
WELL?           E          Let's use a flare
WHICH WAY?      8          Let's see what's north of us
YOU SEE
WARP
WELL?           E          Let's see what's south
WHICH WAY?      2
YOU SEE
GEMS
WELL?           A
WHICH WAY?      4 R/S      Let's go west again...
POS 12
GEMS-12
WELL?           A
WHICH WAY?      4          Keep going west...
POS 11
POS 16                     Must have been a warp! 
*STAFF*                    Great! We have the staff!
WELL?           A
WHICH WAY?      8          Go north again
POS 06
POS 12
YOUR TRACKS
WELL?           A
WHICH WAY?      8          Go north
POS 02
GEMS-14
WELL?           A
WHICH WAY?      8          Go north
POS 92
POS 93
GEMS-18
WELL?           A
WHICH WAY?      8          Go north
POS 83
POS 84
GEMS-20
WELL?           A          
WHICH WAY?      8          Go north
POS 74
POS 81
DEMON                      We finally ran into one...
WELL?           B          Let's fight it!
WEAPON?         5          
DUMB                       Guess that was the wrong amulet
WELL?           B
WEAPON?         3
LIVED                      He's not dead yet!
WELL?           B          Let's try again
WEAPON?         3
GOT HIM
WELL?
Now you can continue the search for the ORB!
Program Listing: The listing below is for the game of the Hobbit. If you key it in exactly as listed, the total bytes should be 835. It requires a size of 051.
Line      Instruction
01         LBL "HOB"
02         CF 06
03         CF 08
04         CF 10
05         CLRG
06         FIX 0
07         "SEED?"
08         XEQ 96
09         STO 09
10         "LEVEL?"
11         XEQ 96
12         STO 08
13         25
14         +
15         STO 00
16         2
17         10^X
18         XEQ 99
19         LBL 00
20         2
21         10^X
22         XEQ 98
23         XEQ 99
24         DSE 00
25         GTO 00
26         7
27         STO 00
28         LBL 01
29         RCL 00
30         200
31         +
32         XEQ 99
33         DSE 00
34         GTO 01
35         RCL 08
36         3
37         +
38         STO 00
39         LBL 02
40         300
41         XEQ 99
42         DSE 00
43         GTO 02
44         400
45         XEQ 99
46         500
47         XEQ 99
48         LBL 13
49         2
50         10^X
51         XEQ 98
52         STO 01
53         XEQ 43
54         X NE 0?
55         GTO 13
56         6
57         XEQ 98
58         85
59         +
60         STO 03
61         8
62         STO 05
63         LBL 30
64         CF 08
65         "POS "
66         10
67         RCL 01
68         X < Y?
69         ->"0"
70         ARCL 01
71         AVIEW
72         RCL 01
73         LBL 36
74         XEQ 43
75         X = 0?
76         GTO 26
77         1
78         %
79         FRC
80         LASTX
81         X <> Y
82         2
83         10^X
84         *
85         X <> Y
86         20
87         +
88         X <> Y
89         GTO IND Y
90         LBL 20
91         FC? 07
92         GTO 14
93         "WARP"
94         LBL 37
95         AVIEW
96         GTO 31
97         LBL 14
98         STO 01
99         GTO 30
100        LBL 21
101        FS? 07
102        GTO 20
103        FS? 09
104        GTO 14
105        RCL 00
106        GTO 40
107        LBL 14
108        "*ORB*"
109        AVIEW
110        SF 10
111        GTO 27
112        LBL 22
113        "AMULET "
114        FS? 07
115        GTO 37
116        ARCL X
117        AVIEW
118        9
119        +
120        5
121        STO IND Y
122        LBL 27
123        900
124        RCL 01
125        XEQ 42
126        LBL 31
127        DSE 03
128        GTO 06
129        FC? 10
130        GTO 39
131        "TOO BAD"
132        AVIEW
133        PSE
134        LBL 39
135        "WIZARD"
136        GTO 32
137        LBL 06
138        "WELL?"
139        CF 07
140        CF 09
141        PROMPT
142        LBL 23
143        "DEMON"
144        FS? 07
145        GTO 37
146        SF 08
147        AVIEW
148        FS? 10
149        GTO 31
150        10.016
151        LBL 59
152        RCL IND X
153        X NE 0?
154        GTO 14
155        RDN
156        ISG X
157        GTO 59
158        "BRIBE?"
159        10
160        XEQ 98
161        XEQ 96
162        X > Y?
163        GTO 05
164        "NOT ENOUGH"
165        LBL 32
166        AVIEW
167        PSE
168        LBL 38
169        "YOU LOSE"
170        PROMPT
171        LBL 05
172        ST- 04
173        RCL 04
174        X < 0?
175        X = 0?
176        GTO 31
177        "TACKY"
178        GTO 32
179        LBL 14
180        DSE IND Y
181        DEG
182        GTO 31
183        LBL 24
184        FS? 07
185        GTO 23
186        "*STAFF*"
187        AVIEW
188        SF 06
189        GTO 27
190        LBL 25
191        "*FLARES*"
192        FS? 07
193        GTO 37
194        AVIEW
195        8
196        ST+ 05
197        GTO 27
198        LBL 29
199        "YOUR TRACKS"
200        AVIEW
201        GTO 31
202        LBL 26
203        "GEMS"
204        FS? 07
205        GTO 37
206        4
207        XEQ 98
208        1
209        +
210        ST+ 04
211        ->"-"
212        ARCL 04
213        AVIEW
214        GTO 27
215        LBL 96
216        CF 22
217        LBL 04
218        PROMPT
219        FC? 22
220        GTO 04
221        RTN
222        LBL A
223        CF 07
223        LBL 35
225        "WHICH WAY?"
226        XEQ 96
227        "YOU SEE "
228        FS? 07
229        AVIEW
230        8
231        X = Y?
232        GTO 07
233        X <> Y
234        6
235        X = Y?
236        GTO 08
237        X <> Y
238        4
239        X = Y?
240        GTO 09
241        X <> Y
241        2
243        X NE Y?
244        GTO 35
245        10
246        LBL 10
247        STO 00
248        LBL 40
249        RCL 01
250        +
251        X < 0?
252        X = 0?
253        GTO 11
254        2
255        10^X
256        +
257        LBL 11
258        2
259        10^X
260        X <> Y
261        X < Y?
262        GTO 14
263        2
264        10^X
265        -
266        LBL 14
267        FS? 07
268        GTO 36
269        STO 01
270        GTO 30
271        LBL 07
272        -10
273        GTO 10
274        LBL 08
275        1
276        GTO 10
277        LBL 09
278        -1
279        GTO 10
280        LBL C
281        FC? 06
282        GTO 14
283        10.016
284        "POS?"
285        0
286        STO 04
287        LBL 12
288        STO IND Y
289        ISG Y
290        GTO 12
291        XEQ 96
292        STO 01
293        SF 09
294        GTO 30
295        LBL E
296        SF 07
297        DSE 05
298        GTO 35
299        GTO 14
300        LBL B
301        FC? 08
302        GTO 14
303        "WEAPON?"
304        XEQ 96
305        9
306        +
307        DSE IND X
308        GTO 09
309        LBL 14
310        "DUMB"
311        AVIEW
312        GTO 31
313        LBL 09
314        10
315        XEQ 98
316        6
317        X > Y?
318        GTO 09
319        "LIVED"
320        AVIEW
321        GTO 31
322        LBL 09
323        "GOT HIM"
324        AVIEW
325        1
326        ST+ 06
327        GTO 27
328        LBL D
329        "YOU WIN"
330        FC? 10
331        GTO 38
332        AVIEW
333        PSE
334        "SCORE= "
335        ARCL 06
336        PROMPT
337        LBL 43
338        STO 07
339        3
340        /
341        INT
342        17
343        +
344        X <> 07
345        3
346        MOD
347        1414
348        X <> Y
349        Y^X
350        RCL IND 07
351        X <> Y
352        ST/ Y
353        X <> Y
354        INT
355        1414
356        MOD
357        RTN
358        LBL 99
359        2
360        10^X
361        XEQ 98
362        X = Y?
363        GTO 99
364        XEQ 43
365        X = 0?
366        GTO 44
367        RUP
368        GTO 99
369        LBL 42
370        XEQ 43
371        LBL 44
372        X <> Y
373        ST* Z
374        *
375        ST- IND 07
376        X <> Y
377        ST+ IND 07
378        RTN
379        LBL 98
380        RCL 09
381        997
382        *
383        FRC
384        STO 09
385        *
386        INT
387        END