Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 0x88

Author: Bruce Moreland

Date: 01:26:42 01/12/99

Go up one level in this thread



On January 12, 1999 at 03:55:37, Louis Verhaard wrote:

>My chess program "Houdini" (which would be a respectable member of the
>"U2000 club") uses another way to represent the board:
> it is an array of 65 ints, 0 meaning
>"the illegal square", and the other ones the real squares.
>Arrays North, South, NorthWest, etc get you to the next rank, file, etc.
>(North[A8] would give the illegal square). KnightMoves gives the list
>of squares that can be reached by a knight from a certain square.
>Other arrays give the file, rank, diagonal, etc. of a certain square.

If you are using C it is more fun to zero-base your arrays, so you'd use either
-1 or 64 as illegal values, typically.

>Two-dimensional arrays can be used for representing other static properties
>about the relations between two squares, for exampe there is
>a KingDistance array that gives the "king distance" between two squares,
>and there is another array "Direction" that tells how two squares are related
>to each other (for example Direction[A1][G7] gives "NorthEast".

This is a big honking array, it's 4096 elements.  You can do this with 0x88 in
255 elements, and it is not a two-dimensional array.

>An advantage of this representation is that the number of squares is
>quite small, which makes the arrays quite small, so in principle you
>can easily make more complex arrays,
>like "can piece P on square A attack square B" (on an empty board),
>although I don't use such arrays.

You get this with a 255-byte array using 0x88.

>I never tried any other approach, so I don't know about performance
>advantages/disadvantages. I like it because it is easy to understand,
>which is good for an amateur, but may be not for all of you guys that
>want to beat deep blue within 3 years.

0x88 is extremely simple.  I've been telling people about it for several years,
since David Kittinger told me about it.  I don't use it, but I have implemented
it and it is very easy, and it is also easy to debug.

bruce



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.