Author: Dan Newman
Date: 23:30:38 03/01/00
Go up one level in this thread
On March 01, 2000 at 21:10:07, William Bryant wrote: >On March 01, 2000 at 20:40:48, John Coffey wrote: > >>On March 01, 2000 at 17:03:44, William Bryant wrote: >> >> >>>Break down your move generator into two functions, one that generates captures >>>and promotions, and one that generates only non-captures. Hopefully, one >>>of the captures will generate a cutoff and the non-captures will not have >>>to be generated at all. >>> >> >>It is hard for me to imagine how this can be done at all? Seems like generating >>the captures would also require you to generate the non-captures. >> >>I assume that the only way this can be done is with bitboards? >> >>John > > >Not at all, (although bitboards do improve the efficiency I would think) >To generate captures only, only accept the moves that have a piece of the >opposite color on the 'to' square. To generate non-caputures, only accept >the moves that move to an empty square. > >That said, the efficiency of generating captures and non-captures separately >on a non-bitboard based program may be poor enough (may almost double the work), >that the benefit of doing them separately may be of little value. > >Just sbe sure to flag your moves so that they can be ordered correctly. > >YMMV (Your milage may vary) > >William >wbryant@ix.netcom.com I think that even in non-bitboard programs this is worth doing, especially if you do the usual capture-quiescence search. I measured this one time and found that my capture generator got called 7-10 times as often as the non-capture generator. In fact the non-capture generator only took something like 2% of the cpu time (and this was in a program that had almost no eval...). So even though you do a lot of repeated work when the non-capture generator gets called, you can balance that against all that work you saved on all those calls to the capture-only generator. It also has the added benefit of not having to separate out the captures. (Actually, you could (as I once did) have separate capture and non-capture move lists...) -Dan.
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.