Re: ELKS port of Adventure - help needed :)

Richard Wallman
2002-12-11T21:27:02Z

On 11 Dec, Phil Goembel wrote:
> I'm guessing, without having looked at the code, that this is not a
> source code problem.

Possible a source code or bcc problem - the area to look at is the
function 'binary' in the 'vocab.c' file.

Put:

printf("binary.vocab: mid=%d lo=%d hi=%d\n",mid,lo,hi);

before and after the line:

mid = (lo + hi) / 2;

(about line 596 - I've been messing with my file)

You'll see in the Linux compilation it follows a very nice textbook
binary tree traversal.

In the ELKS version, it starts out badly and just gets worse.

I haven't found the cause yet - it's been a long day, and my brain
isn't working properly :)~

I thought it might be something to do with overflow, but changing the
int defs to long doesn't help.

Still, there should be enough pointers here for someone to figure it
out... (I'm still working on it as well)

P.S. Phil - I think my mailer used your address rather than the list on
my last post. Forward it if you like, but I think this supersedes it.
--
Richard Wallman