Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: chess programming question

Author: Dr. Gregor Overney

Date: 14:30:59 12/29/98

Go up one level in this thread


On December 29, 1998 at 02:29:41, Jeff Anderson wrote:

>I've begun working on a chess program, and am in the very early stages.  I have
>come up with an idea, or a shortcut, but I fear it may have some negative
>consequences.  In my numerical representation of the chess board, instead of
>having for example 1 for a pawn, 2 for a knight, 3 for a bishop 4 for rook, 5
>for queen, 6 for king, -1 for black pawn and so on, could I not make the
>numerical representation of the piece its value?  For example instead of 2 for a
>knight, the knight could be 300, and a black knight could be -300.  The white
>bishop might be 320 and the black king -5000 and so on.  Would this not kill two
>birds with one stone, and save me the trouble, of assigning the piece values
>another place?  It would make the evaluation much easier, because all I would
>have to do is add up the total value of each element in the board array (not
>counting positional considerations).
>Jeff

Your idea should work. However, considering that in a couple of years we are
using 64-bit computers (some of us already do), I suggest to use Bitboards.
Until your chess program starts playing competitively, many months will pass.
And why not look into the future rather the past?

To represent a chess game position, Bitboards are my choice. On a 64-bit
architecture (such as the 21164 and 21264) Boolean arithmetic with Bitboards
allows you to analyze a position very fast compared to any "array-type" of
representation.

Bitboards and Rotated Bitboards are explained at various places (Web pages and
books). Check out http://home.fda.net/~wzrdking/bitboard.htm for a start. Look
into a program called Crafty for a good implementation of Bitboards
(ftp://ftp.cis.uab.edu/pub/hyatt/v16/).

My thoughts for what they’re worth.

Gregor



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.