Hunt for the Wumpus – TRS-80 Model III

Creative Computing magazine – Anno 1975 – Numero: Settembre/Ottobre – Trascrizione: Fernando Coello

Grazie al lavoro di Fernando Coello, nostro lettore, siamo in grado di presentarvi questo ennesimo listato preservato dall’oblio. Si tratta di un dungeon crawler testuale scritto in Basic per il computer TRS-80 Model III nel 1975!

Fernando ha digitato il listato ed ha voluto condividere con noi il suo lavoro. Ringraziandolo di nuovo per il suo contributo, invitiamo altri lettori a fare lo stesso. 🙂

Il listato originale é apparso sulla rivista Creative Computing magazine nel numero di Settembre/Ottobre del 1975.

Titolo: Hunt for the Wumpus
Piattaforma: TRS-80 Model III
Linguaggio: Basic
Versione originale: Marcel Offermann
Pubblicazione: Creative Computing magazine Set/Ott 1975
Anno: 1975
Trascrizione: Fernando Coello
Anno: 2023

Scopo del gioco
Sei un cacciatore di Wumpus ed il tuo scopo é quello di uccidere la bestia che si annida all’interno del labirinto a forma di Dodecaedro schiacciato dove sei stato catapultato all’inizio del gioco.

Comunque… come catturare il Wumpus! Che ne dite di una freccia che puó girare gli angoli mentre passa da una stanza all’altra? Lasciate che il cacciatore dica alla freccia dove andare e lasciatela volare. Il viaggio di andata e ritorno più breve senza inversioni è di 5 caverne.

Ma, come si individua il Wumpus? È buio nella grotta e la luce lo sveglierebbe. Se si arriva a una stanza di distanza, l’odore distinto del Wumpus serve come avvertimento. Fin qui tutto bene… ma attenzione ai pericoli che si nascondono nelle grotte.

Qui di seguito trovate il codice da copiare sul vostro computer TRS-80 Model III.
Il codice é pronto per essere copiato su un emulatore, consigliamo trs80gp.

Di seguito riportiamo le istruzioni per copiare il listato sull’emulatore TRS-80 ed eseguire il gioco.
TRS80gp permette di leggere un file di testo dal vostro hard-disk e di aggiungerlo come listato BASIC.

Al prompt di benvenuto del DOS digitate BASIC per caricare l’interprete.
Vi verrà quindi chiesto:
– Quanti file? – digitate 1
– Dimensione della memoria? – premete pure il tasto Invio

Dal menu Edit è possibile selezionare Paste file e quindi il file txt che ho allegato. Si carica velocemente. Digitare RUN e… Buon divertimento!

Si ringrazia Fernando Coello per la condivisione di questo listato.

Attenzione – Ci siamo resi conto che nel listato i caratteri ‘>’ e ‘<‘ potrebbero venir sostituiti dai rispettivi encoding html ‘&gt’ e ‘&lt’. Nel caso, sostituite questi valori nel listato prima di copiarlo sull’emulatore.

Listato: Hunt for the Wumpus – TRS-80 Model III – Basic


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
10 cls : print @412, "WUMPUS 1"
20 print : print TAB(7) "COPYRIGHT 1979  CREATIVE COMPUTING MORRISTOWN, NJ"
30 print @960, ""; : input "DO YOU NEED INSTRUCTIONS"; i$
40 if left$(i$,1)="N" then goto 60
50 gosub 610 : rem instructions
60 cls : rem SET UP CAVE
70 dim s(20,3)
80 for j=1 to 20
90 for k=1 to 3
100 read s(j,k)
110 next k
120 next j
130 data 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
140 data 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
150 data 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
160 data 15,17,20,7,16,8,9,17,19,11,18,20,13,16,19
170 rem LOCATE L ARRAY ITEMS
180 rem 1 YOU / 2 WUMPUS / 3 & 4 PITS / 5 & 6 BATS
190 dim l(6), m(6)
200 for j=1 to 6
210 let l(j) = rnd(20)
220 let m(j) = l(j)
230 next j
240 rem CHECK FOR CROSSOVERS (example l(1)=l(2))
250 for j=1 to 6
260 for k=j to 6
270 if j=k then goto 290
280 if l(j)=l(k) then goto 200 : rem goto 210
290 next k
300 next j
310 rem SET ARROWS
320 let a = 5
330 let l=l(1)
340 rem RUN THE GANE
350 cls : print tab(24);"HUNT THE WUMPUS" : print
360 rem HAZARD WARNINGS & LOCATIONS
370 for ax=1 to 1000 : next ax
372 print @128, chr$(31);
375 gosub 1100
380 rem MOVE OR SHOOT
390 gosub 1270
400 on o goto 420, 460
402 rem if o=1 then goto 420
404 rem if o=2 then goto 460
410 rem SHOOT
420 gosub 1360
430 if f=0 then goto 370
440 goto 480
450 rem MOVE
460 gosub 1860
470 if f=0 then goto 370
480 if f>0 then goto 530
490 rem LOSE
500 print "HA HA HA - YOU LOSE!"
510 goto 540
520 rem WIN
530 print "HEE HEE HEE - THE WUMPUS'LL GETCHA NEXT TIME!"
540 for j=1 to 6
550 l(j)=m(j)
560 next j
570 print : print "SAME SET-UP (Y/N) OR QUIT (Q)"
580 input i$
590 i$=left$(i$,1)
600 if i$="N" then goto 200 else if i$="Y" then goto 320 else end
602 rem if i$="N" then goto 200
604 rem if i$="Y" then 320
605 end : rem stop
609 rem INSTRUCTIONS
610 rem
620 cls : print tab(28);"WUMPUS 1" : print
630 print " THE WUMPUS LIVES IN A CAVE OF 20 ROOMS. EACH ROOM"
640 print "HAS 3 TUNNELS LEADING TO OTHER ROOMS. (LOOK AT A"
650 PRINT "DODECAHEDRON TO SEE HOW THIS WORKS - IF YOU DON'T KNOW"
660 PRINT "WHAT A DODECAHEDRON IS, ASK SOMEONE)"
670 PRINT
680 PRINT "     HAZARDS:"
690 print "BOTTOMLESS PITS - TWO ROOMS HAVE BOTTOMLESS PITS IN THEM"
700 print"      IF YOU GO THERE, YOU FALL INTO THE PIT (& LOSE!)"
710 print "SUPERBATS - TWO OTHER ROOMS HAVE SUPER BATS. IF YOU"
720 print "     GO THERE, A BAT GRABS YOU AND TAKES YOU TO SOME";
730 print " OTHER"
740 print "     ROOM AT RANDOM. (WHICH MAY BE TROUBLESOME)"
750 print @979, "PRESS ANY KEY TO CONTINUE";
760 if inkey$="" then 760 else print @128, chr$(31);
770 print "     WUMPUS:"
780 print "     THE WUMPUS IS NOT BOTHERED BY THE HAZARDS (HE HAS SUCKER"
790 print "FEET AND IS TOO BIG FOR A BAT TO LIFT). USUALLY"
800 print "HE IS ASLEEP. TWO THINGS THAT WAKE HIM UP: YOUR ENTERING"
810 print "HIS ROOM OR YOUR SHOOTING AN ARROW."
820 print "     IF THE WUMPUS WAKES, HE MOVES ONE ROOM"
830 print "OR STAYS STILL. AFTER THAT, IF HE IS WHERE YOU"
840 print "ARE, HE EATS YOU UP (& YOU LOSE!)"
850 print@979, "PRESS ANY KEY TO CONTINUE";
860 if inkey$="" then goto 860 else print@128, chr$(31);
870 print "     YOU:"
880 print "EACH TURN YOU MAY MOVE OR SHOOT A CROOKED ARROW" : print
890 print "     MOVING: YOU CAN GO ONE ROOM (THRU ONE TUNNEL)"
900 print "     ARROWS: YOU HAVE 5 ARROWS. YOU LOSE WHEN YOU RUN OUT. "
910 print "     EACH ARROW CAN GO FROM 1 TO 5 ROOMS. YOU AIM BY ";
920 print "TELLING"
930 print "     THE COMPUTER THE ROOMS YOU WANT THE ARROW TO GO TO. "
940 print "     IF THE ARROW CAN'T GO THAT WAY (I.E. NO TUNNEL) IT ";
950 print "MOVES"
960 print "     AT RANDOM TO THE NEXT ROOM. " : print
970 print "       IF THE ARROW HITS THE WUMPUS, YOU WIN. "
980 print "       IF THE ARROW HITS YOU, YOU LOSE. "
990 print @979, "PRESS ANY KEY TO CONTINUE";
1000 if inkey$="" then goto 1080 else print@128, chr$(31);
1010  print "     WARNINGS:"
1020  print "      WHEN YOU ARE ONE ROOM AWAY FROM WUMPUS OR HAZARD,"
1030 print "     THE COMPUTER SAYS:" : print
1040 print "WUMPUS-   'I SMELL A WUMPUS'"
1050 print "BAT   -   'BATS NEARBY'"
1060 print "PIT   -   'I FEEL A DRAFT'"
1070  print @979, "PRESS ANY KEY TO CONTINUE";
1080 if inkey$="" then goto 1080 else print @128, chr$(31);
1090 return
1090 return : rem end proc
1100 rem PRINT LOCATION & HAZARD WARNINGS
1110 print
1120 for j=2 to 6
1130 for k=1 to 3
1140 if s(l(1),k)<>l(j) then goto 1210
1142 rem if j-1=1 then goto 1160
1144 rem if j-1=2 then goto 1180
1146 rem if j-1=3 then goto 1180
1148 rem if j-1=4 then goto 1200
1149 rem if j-1=5 then goto 1200
1150 on j-1 goto 1160, 1180, 1180, 1200, 1200
1160 print "I SMELL A WUMPUS!"
1170 goto 1210
1180 print "I FEEL A DRAFT!"
1190 goto 1210
1200 print "BATS NEARBY!"
1210 next k
1220 next j
1230 print "YOU ARE IN ROOM ";l(1)
1240 print "TUNNELS LEAD TO ";s(l,1);s(l,2);s(l,3)
1250 print
1260 return
1270 rem CHOOSE OPTION
1280 print "SHOOT OR MOVE (S/M) ";
1290 input i$
1300 if i$<>"S" then goto 1330
1310 let o=1
1320 return
1330 if i$<>"M" then goto 1280
1340 let o=2
1350 return
1360 rem ARROW ROUTINE
1370 let f=0
1380 rem PATH OF ARROW
1390 let l=l(1)
1400 print "NO. OF ROOMS (1-5) ";
1410 input rs : rem rs = j9
1420 if rs<1 or rs>5 then goto 1400
1430 for k=1 to rs
1440 print "ROOM #";
1450 input p(k)
1460 if k<=2 then goto 1500
1470 if p(k)<>p(k-2) then goto 1500
1480 print "ARROWS AREN'T THAT CROOKED - TRY ANOTHER ROOM"
1490 goto 1440
1500 next k
1510 rem SHOOT ARROW
1520 for k=1 to rs
1530 for k1=1 to 3
1540 if s(l,k1)=p(k) then goto 1700
1550 next k1
1560 rem NO TUNNEL FOR ARROW
1570 let l=s(l,rnd(3))
1580 goto 1710
1590 next k
1600 print "MISSED"
1610 l=l(1)
1620 rem MOVE WUMPUS
1630 gosub 1780
1640 rem AMMO CHECK
1650 let a=a-1
1660 if a>0 then goto 1680
1670 cls : print "YOU'RE OUT OF ARROWS" : print
1675 let f=-1
1680 return
1690 rem SEE IF ARROW IS AT L(1) OR L(2)
1700 let l=p(k)
1710 if l<>l(2) then goto 1750
1720 cls : print "AHA! YOU GOT THE WUMPUS!"
1730 let f=1
1740 return
1750 if l<>l(1)then goto 1590
1760 cls : print "OUCH! ARROW GOT YOU!"
1770 let f=-1
1775 return
1780 rem MOVE WUMPUS ROUTINE
1790 let k=rnd(4)
1800 if k=4 then goto 1820
1810 let l(2)=s(l(2),k)
1820 if l(2)<>l then goto 1850
1830 cls : print "TSK TSK TSK - WUMPUS GOT YOU!"
1840 let f=-1
1850 return
1860 rem MOVE ROUTINE
1870 let f=0
1880 print "WHERE TO ";
1890 input l
1900 if l<1 or l>20 then 1880
1910 rem CHECK IF LEGAL MOVE
1920 for k=1 to 3
1930 if s(l(1),k)=l then goto 1990
1940 next k
1950 if l=l(1) then goto 1990
1960 print "NOT POSSIBLE ";
1970 goto 1880
1980 rem CHECK FOR HAZARDS
1990 let l(1)=l
2000 rem WUMPUS
2010 if l<>l(2) then goto 2080
2020 print " ... OOOPS! BUMPED A WUMPUS!"
2030 rem MOVE WUMPUS
2040 gosub 1790
2050 if f=0 then goto 2080
2060 return
2070 rem PIT
2080 if l<>l(3) and l<>l(4) then goto 2130
2090 print "YYYIIIEEEEE ... FELL IN PIT!"
2100 let f=-1
2110 return
2120 rem BATS
2130 if l<>l(5) and l<>l(6) then goto 2170
2140 print "ZAP - SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!"
2150 let l=rnd(20)
2160 goto 1990
2170 return
2180 end : rem stop
3000 end

Share

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.