Computer Chess Club Archives


Search

Terms

Messages

Subject: Could Not Be Check

Author: Mike Curtis

Date: 09:57:59 06/07/00


Could Not Be Check
------------------

If a chess program tests for CHECK very often (for example in quiesce)
and the attack() routine is expensive, (no bitboards) there is an
opportunity to win X percent time by examining the previous move.

Adjust the src and dest squares relative to the opposing king.

/* --- cnbc_dest[] screens squares which give check. --- */

bool_t
cnbc_dest[] = {
  0,0,0,0,0,0,0,0,
  0,0,0,1,1,1,1,1,
  0,0,0,1,1,1,1,1,
  0,1,1,0,1,1,1,1,
  0,1,1,1,0,1,1,1,
  0,1,1,1,1,0,1,1,
  0,1,1,1,1,1,0,1,
  0,1,1,1,1,1,1,0
};

/* --- cnbc_src[] screens discovered checks. --- */

bool_t
cnbc_src[] = {
  0,0,0,0,0,0,0,1,
  0,0,1,1,1,1,1,1,
  0,1,0,1,1,1,1,1,
  0,1,1,0,1,1,1,1,
  0,1,1,1,0,1,1,1,
  0,1,1,1,1,0,1,1,
  0,1,1,1,1,1,0,1,
  1,1,1,1,1,1,1,1
};


/* --- En passant and castling are exceptions. --- */

bool_t incheck;

/* --- save up to X % on timer (y.m.m.v.) --- */
if (could_not_be_check(prev_move_ptr)) incheck = NOPE;
else incheck = any_attackers(king_square);



FathomEngine
-Mike



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.