Author: Dann Corbit
Date: 16:21:01 10/22/04
Go up one level in this thread
On October 22, 2004 at 19:04:05, Russell Reagan wrote: >On October 22, 2004 at 17:28:39, Dann Corbit wrote: > >>If you use bitmaps, you can calculate all the attacks (and even the pins and >>half-pins) in a single table lookup for any ray of attacks. >> >>For any position on the board, there are at most 7 squares attacked along a ray >>(since you never attack the square you sit on). Now, of those 7 squares there >>are exactly 128 different bit occupation patterns. So you precompute a table of >>those patterns. > > >If you are only generating attacks, then you only need the inner 6 bit >occupation state to generate attacks, so a 64 element lookup table will do. I >guess you use a 7-bit occupation state since you are also detecting pinned >pieces, xrays, etc. where the state of the end square is required. Is that the >case? Yes. I also want to know things like: "how many opponent pawns attack this square?" "how many opponent knights/bishops attack this square?" "how many opponent rooks attack this square?" "how many opponent queens attack this square?" "Does the opponent king attack this square?" "how many friendly pawns attack this square?" "how many friendly knights/bishops attack this square?" "how many friendly rooks attack this square?" "how many friendly queens attack this square?" "Does my king attack this square?" A square that is attacked by any opposing piece is not kingsafe. You can store up the attack counts by type/color to see if a square is safe to step on for another piece type. Even half-pin data can be useful (e.g. 'If I move this piece, it will generate a pin')
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.