Computer Chess Club Archives


Search

Terms

Messages

Subject: What is the Attaks_From[64] table used to in Crafty ?

Author: Mathieu Pagé

Date: 11:15:19 11/09/04


Hi, the subject explain it all, I thought that it was used to generate moves,
but I see that it is not the case as in this example comming from crafty's
MOVGEN.C, The function AttacksQueen(from) is used insted of Attaks_from[from]:

/*
 ----------------------------------------------------------
|                                                          |
|   now, produce queen moves by cycling through the        |
|   *_queen board to locate a [from] square and then       |
|   generate the AttacksFrom() bitmap which supplies the   |
|   list of valid <to> squares.                            |
|                                                          |
 ----------------------------------------------------------
*/
    piecebd=WhiteQueens;
    while (piecebd) {
      from=LastOne(piecebd);
      moves=AttacksQueen(from) & BlackPieces;
      temp=from+(queen<<12);
      while (moves) {
        to=LastOne(moves);
        *move++=temp|(to<<6)|((-PcOnSq(to))<<15);
        Clear(to,moves);
      }
      Clear(from,piecebd);
    }

So what is attaks_from used for ?

Mathieu Pagé



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.