Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Basic question about bitboards.

Author: Robert Hyatt

Date: 13:28:50 11/01/98

Go up one level in this thread


On November 01, 1998 at 13:07:25, Inmann Werner wrote:

>I read some articles about the bitboards.
>Seems nice!
>But I have one simple problem.
>If I have, lets say, all pawn moves possible, in one bitboard. How can I come
>in a fast way to the moves (extract them from the bitboard). Counting through
>all 64 Bits is ugly and slow.
>
>Can anybody help me?
>
>Werner

you wouldn't do "all" pawn moves... you do them in 4 chunks...  1 move
forward, 2 moves forward for those on the 2nd rank, then capture left and
capture right.  counting thru the bits is not slow, because there aren't
many bits to find...  and when you do find a "to" square, you compute
the from square since you know the type of move you are producing (say white
pushes for 1 square, from = to-8...)




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.