Author: Bryan Hofmann
Date: 07:48:56 05/05/04
Go up one level in this thread
On May 04, 2004 at 19:04:51, Ed Trice wrote:
>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?
Here is a quick EPD test suite I put together on this with a move list in the
test 1 id so you can see why it is a bad take.
r2q1k1r/p1pb1p2/Q3p1p1/3pP2p/3P2n1/NNP4P/PP3PP1/R4RK1 w - - am hxg4; id
"Trojans 01 If hxg4, hxg4 Qb7 Qh4 Qxa8+ Be8 f3 g3 Qxe8+ Kxe8 Nc5 Qh1#";
r2r2k1/ppq1bpp1/2bppn1p/6B1/3NPP1P/2N5/PPPQ2P1/1K1RR3 b - - am hxg5; id
"Trojans 02";
r3k2r/pp1n1pp1/2p1pn2/q6p/PbBP2b1/2N1PN1P/1P1BQPP1/R4RK1 w kq - am hxg4; id
"Trojans 03";
r1bq1rk1/1p2bpp1/p2ppn1p/6B1/3QPPPP/2N5/PPP1B3/R3K2R b KQ - am hxg5; id
"Trojans 04";
r4rk1/ppp2pp1/2n2n1p/3pp1N1/q6P/3PP1PR/P1PB1P2/R2Q1K2 b - - am hxg5; id
"Trojans 05";
rnbq1rk1/ppp1bpp1/4pn1p/6B1/2pP3P/2N1P2N/PP3PP1/2RQKB1R b K - am hxg5; id
"Trojans 06";
r2q1rk1/p2b1pp1/1pnb1n1p/2p1pPB1/3pP2P/1P1P2NN/P1P3P1/R2QKB1R b KQ - am hxg5; id
"Trojans 07";
r1bq1rk1/pp2bpp1/2n1pn1p/2pp2B1/4P2P/2NP2PN/PPP2PB1/R2QK2R b KQ - am hxg5; id
"Trojans 08";
r2q2k1/4bpp1/p1n1rn1p/1pp1p1B1/P2pP2P/1P1P2PN/1NP1QPKR/R7 b - - am hxg5; id
"Trojans 09";
1r3rk1/ppp2pp1/2n2n1p/3pp1N1/7P/q2PP1P1/P1PB1P2/R2Q1K1R b - - am hxg5; id
"Trojans 10";
rn1q1rk1/ppp2pp1/5n1p/3pp1N1/7P/P2PP1P1/P1P2P2/R1BQK2R b KQ - am hxg5; if
Trojans 11";
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.