Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboards, pre-computing moves, and blocked squares?

Author: Steffan Westcott

Date: 11:49:05 11/30/04

Go up one level in this thread


On November 30, 2004 at 12:51:38, Andrew N. Hunt wrote:

>Hi!
>
>I've recently implemented bitboards (standard and rotated) and have a question
>about pre-computing moves which contain blocked squares. Let's say I have the
>occupied rank:
>
>bQ, wN, _, wR, _, bP, bN, _
>
>and I want to find the valid moves for the white Rook. How do I handle modifying
>its bitboard rank: 11010110 to remove the blocked squares and only store the
>available squares: 01101100? (which I can then And with the white/black pieces
>to find valid Rook moves)

An alternative to precomputation (and rotated bitboards altogether) is
computation of attacks on the fly. While not directly addressing your question,
you may never the less like to consider one such approach :
http://chessprogramming.org/cccsearch/ccc.php?art_id=261956

Note that the value of the 'p' parameter for all those functions is normally the
empty_squares bitboard. With careful arrangement and inline expansion of the
function calls in large bitboard calculation code blocks, this gives the
compiler some useful optimisation opportunities, reusing expressions that have
just 'p' and constants as terms.

Cheers,
Steffan



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.