Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bizar Question for programmers: very strange behaviour of my engine

Author: James Swafford

Date: 08:27:35 01/17/06

Go up one level in this thread


On January 16, 2006 at 16:22:10, Dann Corbit wrote:

>On January 16, 2006 at 16:16:13, JW de Kort wrote:
>
>>Hi all,
>>
>>In my engine i want to use the following line:
>
>#include <assert.h>
>...
>
>     assert(kol+1 < sizeof bfZwart / sizeof bfZwart[0]);
>>    !(bfZwart[kol+1]&bfBoven[rij])

That's probably it, but another (less likely) possibility is that
the short-circuit evaluation is not attempting fetch the value from
the bfBoven[] array unless kol+1 > 1 (making bfZwart[kol+1] true).

In other words, is it the case that bfZwart[kol+1] always evaluates
to false?  If so, I doubt the second part of the expression is even
evaluated.  Like I said, not likely, but weird things happen.

--
James


>>
>>In only a few cases this lines crashes my engine. If i change the +1 to any
>>other value there is no problem!
>>
>>Does anybody know were i have to look for to solve this problem? I do not
>>understand how a comparison like the above can cause a program to crash.
>>
>>regards
>>Jan Willem



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.