Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: detecting and evaluating pins

Author: Jaime Benito de Valle Ruiz

Date: 04:20:33 02/23/04

Go up one level in this thread


On February 23, 2004 at 07:02:59, martin fierz wrote:

>aloha,
>
>i have a question about pins. pins are a rather important feature in chess; some
>of them are not so bad, some are deadly. i just happened to chat briefly with
>anthony cozzie on ICC, and he said he didn't do any pin detection. i detect
>pins, but i don't evaluate whether a pin is not so bad or deadly. my questions
>are:
>-> are you detecting pins in your program?
>-> if yes, do you try to distinguish between different pins?
>
>cheers
>  martin


On February 23, 2004 at 07:02:59, martin fierz wrote:

>aloha,
>
>i have a question about pins. pins are a rather important feature in chess; some
>of them are not so bad, some are deadly. i just happened to chat briefly with
>anthony cozzie on ICC, and he said he didn't do any pin detection. i detect
>pins, but i don't evaluate whether a pin is not so bad or deadly. my questions
>are:
>-> are you detecting pins in your program?
>-> if yes, do you try to distinguish between different pins?
>
>cheers
>  martin

I don't detect pins in my engine during move generation, because I tried this in
the past, and it was slower... for me, at least. I generate all pseudo-legal
moves, and captures are always at the top of the list, even before move
ordering.
Just at the beginning of every "make", I check the legality of the move, before
updating bitboards, hash and the rest of the stuff. Here I make sure that the
king doesn't go to an attacked square, that the castling move is legal, the
en-passant, and whether a piece leaves its king under attack because it was
pinned(illegal move). If any move is illegal, then I restore the piece, don't
update anything else in "move", and return an Illegal flag, so the main
alpha-beta search does not call itself, and the move is not undone. This, for
me, works better than going to the next ply and checking whether the king can be
captured.

If a piece is "kind of pinned" (e.g. with the queen behind, instead of the
king), this is detected inmediatly in the next ply, and quickly pruned.
If it's at the leaf node, these mistakes are sorted in the quiescence search the
same way.

Of course, there might be a lot of people with good engines that do detect pins,
or do something very different.

Jaime



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.