Author: Tony Werten
Date: 02:19:37 01/24/02
Go up one level in this thread
On January 24, 2002 at 04:41:38, Uri Blass wrote:
>On January 24, 2002 at 02:19:11, Tony Werten wrote:
><snipped>
>>>Here is our perft function:
>>>
>>>unsigned int perft(Position * board, int depth) {
>>> Position perft_board;
>>> Move_Stack moves[MAX_MOVES];
>>
>>This uses to much stack. Make a global array and you use a pointer to it.
>>
>>> int num_moves,
>>> i;
>>> unsigned int nodes;
>>>
>>> if (depth <= 0) {
>>> return 0;
>>> }
>>>
>>> num_moves = 0;
>>> nodes = 0;
>>>
>>> gen(board, &moves[0], &num_moves);
>>
>>Don't generate all moves at once. At least split it in capture and noncapture
>>moves.
>
>I do not understand why do you need to split it in capture and noncapture moves
>for calculating the perft function.
You don't. It was too early and I didn't see it was a perft function.
>
>I think that it is a waste of time to generate captures and later generate non
>captures when the target is to calculate perft faster but maybe I am wrong(I did
>not try it).
>
>I agree that it seems to be a good idea for a chess playing program because the
>target of a chess playing program is not only to generate moves faster but to
>play better and you need to waste less time in ordering of moves and in qsearch
>later if you generate first captures and later noncaptures.
Not quite. You want to avoid generating moves when the first (or second) move
already gives a cutoff or (as in quiesc) you don't want all of them.
Tony
>
>Uri
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.