Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: sliding attacks in three inlines

Author: Gerd Isenberg

Date: 13:52:36 04/14/04

Go up one level in this thread


i really prefere even more inlines for abstraction...
Isn't there a cheaper tricks to do isCommonA1H8Diagonal, etc. with 0x88?

inline
bool bstyle_attack(int x, int y) {
   if ( isCommonA1H8Diagonal(x, y) )
      return brq_path_clear(x, y, diagonal[1][iGetRank(x) + iGetFile(x)]);
   if ( isCommonH1A8Diagonal(x, y) )
      return brq_path_clear(x, y, diagonal[0][7 + iGetRank(x) - iGetFile(x)]);
   return false;
}

inline
bool rstyle_attack(int x, int y) {
   if ( isCommonFile(x, y) )
      return brq_path_clear(x, y, isqRankBits(x));
   if ( isCommonRank(x, y) )
      return brq_path_clear(x, y, isqFileBits(x));
   return false;
}




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.