Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: The Zappa Attack Table Code - datastructure

Author: Anthony Cozzie

Date: 14:44:20 05/05/04

Go up one level in this thread


All of this stuff is in the position structure.

  //1. Piecelist: Every piece starts out with a unique ID, and keeps it.
  //When a piece is added to the board, just scan through and find a pl
  //entry with the "empty" type.
  zappa_s32 pl[2][16];           //Bits 0-5: Square  Bits 6-9: Piece Type

  //index SQ
  //Bits   0-1: Pawn Attacker count
  //Bits   2-3: Knight Attacker count
  //Bit      4: Bishop Attacker count
  //Bit    5-6: Rook Attacker count
  //Bit    7-8: Queen Attacker count
  //Bit      9: King Attacker count

  //index SQ+64
  //Bits  0-15: Which pieces can legally move to this square (except for en
passant)
  //Bits 16-31: Which pieces xray attack us <- useful for Kingsafety & Capture
Generation
  zappa_u32 at[2][128];           //Attack tables

  //Masks for the attack tables, delineating which squares are what.
  //So at[1][A1+64] >> 16 & idm[1][1] gives us all wpawns attacking square A1,
etc.
  zappa_u32 idm[2][8];

  //specialized masks for multiple types
  zappa_u32 bqidm[2];
  zappa_u32 rqidm[2];
  zappa_u32 slideridm[2];

anthony



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.