๐ซ For paid/consultancy work on projects like Infix, reach me through my employer, Addiva Elektronik, talk to Lennart
troglobit / adventure Goto Github PK
View Code? Open in Web Editor NEWClassic Colossal Cave Adventure
License: The Unlicense
Classic Colossal Cave Adventure
License: The Unlicense
๐ซ For paid/consultancy work on projects like Infix, reach me through my employer, Addiva Elektronik, talk to Lennart
I've been having fun porting this to a 6502 forth and noticed that altho advent.h
defines the HINTx conditions these don't seem to be referenced in the code. The hint messages are present in advent4.h
(e.g. #63) but I can't find any equivalent of the checkhints
routine from the open-adventure code.
advent.h:#define HINTC 16
advent.h:#define HINTB 32
advent.h:#define HINTS 64
advent.h:#define HINTM 128
advent.h:#define HINT 240
also doc/advent.txt
mentions the feature, but maybe disappeared again later?
J) Hint feature restored with original messages
(exact original algorithm unknown)
I'd be happy to try and restore if you have any traces of the original code.
I'm very excited that you've done this port! I didn't find the commands to build in the readmes, so I made my best guess as to how to build it:
./autogen
./configure
make
(were there instructions I missed?) I started the game by running src/advent
, but pretty quickly I ran into problems with it not recognizing commands. "take lamp" etc worked, but "follow stream" yields "I don't know how to apply that word here." (and no directions work to get me to the grate). Looks like either a problem with my compile or a bug in the program?
There are a couple of places in the turn.c file where the code accesses arrays out-of-bounds.
The following code segment will access the non existent elements prop[MAXOBJ] and place[MAXOBJ] (via toting() function).
85 if (closed) {
86 if (prop[OYSTER] < 0 && toting(OYSTER))
87 pspeak(OYSTER, 1);
88 for (i = 1; i <= MAXOBJ; ++i)
89 if (toting(i) && prop[i] < 0)
90 prop[i] = -1 - prop[i];
91 }
The following code will access place[MAXOBJ] (via toting() function). The call to dstroy() may or may not be a problem, that function allows values >= MAXOBJ, but may not give the intended result here.
792 for (i = 1; i <= MAXOBJ; ++i)
793 if (toting(i))
794 dstroy(i);
In the file database.c there appears to be a related problem in the move() function, where a value >= MAXOBJ will access the fixed array out-of-bounds - the intended array element is likely fixed[obj - MAXOBJ].
298 /*
299 Routine to destroy an object
300 */
301 void dstroy(int obj)
302 {
303 move(obj, 0);
304 }
305
306 /*
307 Routine to move an object
308 */
309 void move(int obj, int where)
310 {
311 int from;
312
313 from = (obj < MAXOBJ) ? place[obj] : fixed[obj];
314 if (from > 0 && from <= 300)
315 carry(obj, from);
316 drop(obj, where);
317 }
318
The arrays are declared in the advdef.h file with a size of MAXOBJ
26 int place[MAXOBJ]; /* object location */
27 int fixed[MAXOBJ]; /* second object loc */
28 int visited[MAXLOC]; /* >0 if has been here */
29 int prop[MAXOBJ]; /* status of object */
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.