The Museum of HP Calculators

# Hunt the Wumpus for the HP-41C/CV/CX

This program is Copyright © HP and is used here by permission. It was originally printed in the Games Solution Book. This program was entered and uploaded by Tony Duell. The documentation was entered by Dave Hicks. The Barcode for this program was provided by Brian Ward.

This program is supplied without representation or warranty of any kind. Tony Duell, Hewlett Packard and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

## Overview

There are 20 caves each connected to 3 others. There are 6 occupied caves: 2 with super bats, 2 with pits, 1 with a wumpus, and 1 with a hunter (you). The object is to move from cave to cave, watching the warnings to see what is nearby, find the wumpus and shoot it with an arrow. You may only move or shoot into an adjacent cave.

The warnings are as follows:

"SMELL WUMPUS" -- The wumpus is in an adjacent cave.

"FEEL A DRAFT" -- Pits are in adjacent cave(s).

"HEAR SQUEAKS" -- Super bats are in adjacent cave (s ) .

If you walk into the cave with the wumpus he will eat you. If you shoot an arrow and miss (by shooting into the wrong cave), you wake the wumpus up and he moves to one of his adjacent caves. If it's the cave you are in, he eats you. Since he has sucker feet he can walk into a cave with pits without falling. And, since he is too heavy for the bats, they cannot bother him. If you walk into a cave with pits, you fall and the game is ended. If you walk into a cave with super bats, they will carry you to some other cave randomly chosen. If the wumpus, pits, or more super bats are there, you will suffer their consequences. The bats then return to their original cave.

Each time you move you will first see the consequences (if any) of your move: "CHOMP" means you've been eaten by the wumpus, "YYIIIEEEE..." means you've fallen into a pit, and "SNATCH" followed by "MOVED TO ( )" means the super bats have grabbed you and moved you. After the consequences you see any warnings that are appropriate. Last, you will see the cave you are in followed by your adjacent caves.

The caves are arranged as a dodechedron with each vertex being a cave and each edge a tunnel.

Note: Requires 1 Memory Module on HP-41C

## Instructions

 Step Instructions Input Data/Units Keys Output Data/Units 1 Enter program 2 Initialize [XEQ] WUMPUS SEED? 3 Key in number between 0 and 1 seed [R/S] (warnings) (caves) 4 To move: cave # [A] (consequences) (warnings) (caves) 5 To shoot an arrow: cave # [B] (consequences) (warnings) (caves) 6 To see warnings and caves again: [C] (warnings) (caves) 7 For another game: [E] (warnings) (caves) 8 Go to step 4 or 5.

## Example

```   Keystrokes:          Display:
[XEQ] [ALPHA] SIZE
[ALPHA] 012
[XEQ] [ALPHA]
WUMPUS [ALPHA]       SEED?
.1232123 [R/S]       HEAR SQUEAKS
[R/S]                6-1,7,15
1 [A]                SNATCH
[R/S]                MOVED TO 3
[R/S]                HEAR SQUEAKS
[R/S]                3-4,2,10
10 [A]               FEEL A DRAFT
[R/S]                10-3,11,9
11 [A]               SMELL WUMPUS
[R/S]                11-18,12,10
12 [B]               11-18,12,10
18 [A]               SMELL WUMPUS
[R/S]                18-11,19,17
19 [B]               18-11,19,17
17 [A]               SMELL WUMPUS
[R/S]                FEEL A DRAFT
[R/S]                17-9,18,16
9 [A]                YYIIIEEEE
```

(Note that you should have known pits were there from your pass through cave 10 and its warnings.)

How to get this Program to your Calculator (via HP-IL, disk, wand, and fingers)
Display the Program Barcode (.pdf) for printing and scanning

## Program Listing

```LINE  KEYS
01 LBL "WUMPUS"
02 0
03 "SEED?"
04 PROMPT
05 STO 00
06 SF 27
07 LBL E
08 FIX 00
09 CF 29
10 1.006
11 STO 10
12 LBL 13
13 RCL 10
14 INT
15 1
16 -
17 STO 11
18 20
19 XEQ 99
20 1
21 +
22 LBL 12
23 RCL IND 11
24 X<>Y
25 X=Y?
26 GTO 13
27 DSE 11
28 GTO 12
29 STO IND 10
30 ISG 10
31 GTO 13
32 LBL C
33 LBL 20
34 RCL 01
35 XEQ 50
36 "SMELL WUMPUS"
37 RCL 02
38 XEQ 21
39 "FEEL A DRAFT"
40 RCL 03
41 XEQ 21
42 RCL 04
43 XEQ 21
44 "HEAR SQUEEKS"
45 RCL 05
46 XEQ 21
47 RCL 06
48 XEQ 21
49 LBL 22
50 CLA
51 ARCL 01
52 "- "
53 ARCL 07
54 ", "
55 ARCL 08
56 ", "
57 ARCL 09
58 AVIEW
59 RTN
60 LBL 21
61 RCL 07
62 X<>Y
63 X=Y?
64 AVIEW
65 RCL 08
66 X<>Y
67 X=Y?
68 AVIEW
69 RCL 09
70 X=Y?
71 AVIEW
72 RTN
73 LBL A
74 XEQ 14
75 FS? 00
76 GTO 22
77 STO 01
78 GTO 09
79 LBL B
80 XEQ 14
81 FS? 00
82 GTO 22
83 RCL 02
84 X=Y?
85 GTO 11
86 XEQ 50
87 3
88 XEQ 99
89 7
90 +
91 RCL IND X
92 STO 02
93 RCL 01
94 XEQ 50
95 LBL 09
96 2.006
97 STO 10
98 RCL 01
99 LBL 08
100 RCL IND 10
101 X<>Y
102 X=Y?
103 GTO IND 10
104 ISG 10
105 GTO 08
106 GTO 20
107 LBL 02
108 "CHOMP"
109 AVIEW
110 RTN
111 LBL 03
112 LBL 04
113 "YYIIIEEEE..."
114 AVIEW
115 RTN
116 LBL 05
117 LBL 06
118 "SNATCH"
119 AVIEW
120 20
121 XEQ 99
122 1
123 +
124 STO 01
125 "MOVED TO "
126 ARCL 01
127 AVIEW
128 PSE
129 GTO 09
130 LBL 11
131 "GOT HIM"
132 BEEP
133 AVIEW
134 RTN
135 LBL 14
136 CF 00
137 RCL 07
138 X=Y?
139 RTN
140 X<>Y
141 RCL 08
142 X=Y?
143 RTN
144 X<>Y
145 RCL 09
146 X=Y?
147 RTN
148 "ILLEGAL CAVE"
149 AVIEW
150 SF 00
151 RTN
152 LBL 99
153 RCL 00
154 9821
155 *
156 .21137
157 +
158 FRC
159 STO 00
160 *
161 INT
162 RTN
163 LBL 50
164 CF 00
165 5
166 X<>Y
167 STO 10
168 X<=Y?
169 GTO 10
170 15
171 X<>Y
172 X<=Y?
173 GTO 11
174 2
175 *
176 25
177 -
178 STO 07
179 21
180 RCL 10
181 1
182 +
183 16
184 RDN
185 X=Y?
186 R^
187 STO 08
188 15
189 RCL 10
190 1
191 -
192 X=Y?
193 20
194 X=0?
195 RDN
196 STO 09
197 RTN
198 LBL 10
199 1
200 +
201 X>Y?
202 1
203 STO 07
204 RCL 10
205 1
206 -
207 X=0?
208 5
209 STO 08
210 RCL 10
211 2
212 *
213 4
214 +
215 STO 09
216 RTN
217 LBL 11
218 2
219 /
220 FRC
221 X=0?
222 SF 00
223 25
224 RCL 10
225 FS? 00
226 4
227 FS? 00
228 CHS
229 CF 00
230 +
231 2
232 /
233 STO 07
234 16
235 RCL 10
236 1
237 +
238 X=Y?
239 6
240 STO 08
241 5
242 RCL 10
243 1
244 -
245 15
246 RDN
247 X=Y?
248 R^
249 STO 09
250 RTN
251 END
```