Author: Gerd Isenberg
Date: 02:24:39 10/16/02
Go up one level in this thread
On October 15, 2002 at 19:29:55, Steffan Westcott wrote: >Gerd, > >For generating the "all attacked squares" bitboard, you approach is fine. >However, you may also want to generate moves (or square control info, SEE inputs >etc.) at the same time, or at least keep some useful side results to generate >the moves later. > >My suggestion is to generate move lists as a collection of bitboards, where each >has set bits corresponding to destination squares for particular move types. The >trick is to do this such that determining the source square or moving piece type >(useful for SEE) is trivially known beforehand or very cheaply calculated when >required. In my example, I presented calculation of upward rook moves. Note that >only 1 rook may move upward to a given square. So, given a destination square, >finding the _unique_ source square (the _unique_ moving rook) is a bit easier >than starting off with "allRookAttacks" which has no move direction information >(not to mention the possibility of several rooks able to move to the destination >square : Lots of conditional branching...). Keeping track of which moves you've >searched easy too - Just reset a single bit in the destination square bitboard. > >To generate an "all attacked squares" bitboard, simply OR the various final >bitboards together (RookAttacksUp | RookAttacksDown | ...). By doing these >bitwise ORs early as part of your fundamental routines, you are losing >information on the type and direction of the moving pieces. > >Cheers, >Steffan I have it now. Great idea, Steffan. So for move generation purposes you need four bitboards for rooks/queens, four for bishops/queens, two for pawn captures(right captures, left captures) and one for pawn moves. But it seems that knights don't fit inside this scheme, getting disjoint direction attacks sets, because they requires eight directions. So i guess knight and king moves should be generated by traversing singular attack bitboards, determined with cheap lookup. Cheers, Gerd
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.