Knight's Challenge in D

Chris R. Miller lordSaurontheGreat at gmail.com
Wed Apr 2 21:14:49 PDT 2008


Tower  Ty Wrote:

> Good stuff Chris
> 
> I got one to run at least and found the original problem. I followed your advice and the first time I got 2 .svg files . The first of which worked and looked good . The second gave me an array out of bounds error.
> 
> I'll have a closer look in a few hours as I have to go out but I'll chuck it in here anyway in case you spot it immediately. This was the second try which ave out of bonds on the first.result.

[snip!]

Well, naturally I was quite amazed that it made an error on what looks like good output.  However, then I looked closely.  You have two linefeeds in between solution sets.  I cut it down to one, and it ran just fine.

The issue is due to the parser making a blank board in the event that it finds two newlines in a row.  It then tries to treat it like a normal board with things in it.  When it tries to snip a trailing space off of the end of an array, it tries to find an array index at -1.

I'll be patching the source file shortly to fix that little bug.  Thanks for the catch.

Also of note, since you made some comments about freedom of speech, I decided to try and open up both the ticket system and forum to unregistered users.  The people on the Trac site have their ticket system open to everyone, so that can't be all too bad.  The forum I'm not so sure about, but I just reasoned that I'll leave it open until the first spambot targets it.

Thanks for that input, it's really helping make the site better.




More information about the Digitalmars-d mailing list