Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Problem searching too deep!

Author: Daniel Clausen

Date: 09:31:44 05/28/02

Go up one level in this thread


On May 28, 2002 at 11:08:00, Sune Fischer wrote:

>>>I also have the maximum number of pseudo legal moves set to 255, this must
>>>be a potential bug too then?
>>
>>I think that the max number of legal moves is around 220. It's very well
>>possible that the number of pseudo legal moves is above 255. So to answer
>>your question: yes =)
>
>Hmmm 35 pins in one position I dare say must be impossible.

You don't need 35 (=255/7 approx) pins for that. If a legal position can have
220 moves, you only need about (255-220)/7 = 5 pins. :)

Anyway, my point was that _I_ prefer to sacrifice 1/2500 of speed (that's your
calculations somewhere :) so that I don't have to make these calculations at
all. YMMV :)


>>Hint: Another possibility would be to check at the end of movegen how many
>>moves
>>you added in total. If your movegen gets a 'move_t *' and increments this
>>pointer each time you add a move, it's a simple subtraction to find out the
>>number of generated moves. (and an if-statement of course for the test :)
>
>Actually this is exactly how I do it :)
>but checking _after_ I add the move is too late, I need to check before
>adding, it is the adding that will crash it if array bounds are exceeded.

Agreed. So forget my hint. :)


>Yes, I do have some checks on the FEN, but I have not accounted for every
>possible broken fen possible. It's something I do plan to secure in the
>future, but its not very high on my list of priorities to be honest.

Yeah, it's also not very high on my list, to be honest. On the positive side, if
the engine crashes it's either because the FEN was wrong or because we overran
an array. =)

Sargon



This page took 0 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.