Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: questions?

Author: Dan Honeycutt

Date: 08:17:49 04/08/04

Go up one level in this thread


On April 08, 2004 at 07:10:29, Daniel Shawul wrote:

>Hi
>Here are some questions
>
>[snip]
>3.I have implemented attack tables
>    2 bits for pawns
>    2  for bishop/knight
>    2  for rooks
>    1  for queen
>    1  for king
> The reason that i chose this one over ed's is
>   1.if i need to change to incremental updating this one will be more
>comfortable
>   2.can tell exact nos of each attacking piece [easier for SEE]
>   3.incase of overflow,for example 2 queens will promote to 1 rook
> whick "I think" is good for SEE. It is very rare the data gets corrupted
> by lots of attackers.
> The only drawback i can see of this method is if there is something that you do
>with only the type of attackers[ie you don't need counts] you need to use
>a 256 array than a 32. What do you think?
>[snip]
>
>Thanks
>Daniel

I use same scheme.  following is my "translation" of Ed's TABLE[32] to a
TABLE[256] which i load at start.  You are welcome to use/modify as you wish.

  int i, n1, n2;
  char v1;
  for (i=0; i<256; i++) {
    v1 = 0;
    //king & pawn(s)
    n1 = i & 3;
    if (i & 128) n1++;
    //pieces (except queen)
    n2 = ((i >> 2) & 3) + ((i >> 4) & 3);
    if (n2) {             //piece(s) attack
      if (n1) v1++;       //piece(s) + pawn/king
      if (n2 > 1) v1++;   //multiple pieces
      if (i & 64) v1++;   //plus queen
    } else if (n1) {      //pawn/king only attack
      if (n1 > 1) v1++;   //multiple pawns/king
      if (i & 64) v1++;   //plus queen
    }
    TABLE[i] = v1;
  }

Dan H.




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.