Computer Chess Club Archives


Search

Terms

Messages

Subject: Crafty's "Trojan Horse" Attack Detector

Author: Ed Trice

Date: 16:04:51 05/04/04


A snippet from the Crafty evaluation routine:

/*
 ----------------------------------------------------------
|                                                          |
|   first, check for the "trojan horse" attack where the   |
|   opponent offers a piece to open the h-file with a very |
|   difficult to refute attack.                            |
|                                                          |
 ----------------------------------------------------------
*/


  if (trojan_check)
  {
    if (root_wtm && File(WhiteKingSQ) >= FILEF)
    {
      if (!(bb=tree->all_pawns&file_mask[FILEJ]).b1 && !bb.b2)
      {
        if ((BlackRooks.b1 || BlackRooks.b2) && (BlackQueens.b1 ||
BlackQueens.b2)) score-=KING_SAFETY_MATE_THREAT;
      }
    }
    if (Flip(root_wtm) && File(BlackKingSQ) >= FILEF)
    {
      if (!(bb=tree->all_pawns&file_mask[FILEJ]).b1 && !bb.b2)
      {
        if ((WhiteRooks.b1 || WhiteRooks.b2) && (WhiteQueens.b1 ||
WhiteQueens.b2)) score+=KING_SAFETY_MATE_THREAT;
      }
    }
  }


Does anyone have a concrete example of what position, or family of positions,
this code is encouraging the program to seek or avoid?



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.