Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Trying to understand 0x88

Author: Daniel Clausen

Date: 06:55:56 10/30/03

Go up one level in this thread


On October 30, 2003 at 09:49:28, Edward Seid wrote:

>I'm trying to understand 0x88 board representation.  My reference is Bruce
>Moreland's page at http://www.seanet.com/~brucemo/topics/0x88.htm  Note that I'm
>not a C programmer, so please explain in generic coding terms.
>
>I've figured out that (index & &H88) is used to determine if the square is on
>the board.  The square is off the board if (index & &H88) = &H08, &H80 or &H88.
>
>My question is... is there a quick way to determine if (index & &H88) is equal
>to any of those 3 numbers?  Since I'm programming in Visual Basic, the best that
>I've come up with is:
>
>mask = index And &H88
>If (mask = &H08) Or (mask = &H80) Or (mask = &H88) Then
>   ' square is off board
>Else
>   ' square is on board
>End If

No need to do that. If (mask and &H88) is not equal to zero, you're off the
board. Either that or I didn't understand what you're asking.

Sargon



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.