Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: about in_check()

Author: Uri Blass

Date: 19:29:20 06/14/03

Go up one level in this thread


On June 14, 2003 at 19:53:10, Magoo wrote:

>On June 14, 2003 at 17:24:56, Uri Blass wrote:
>
>>On June 14, 2003 at 17:11:11, JW de Kort wrote:
>>
>>>On June 14, 2003 at 10:30:58, Magoo wrote:
>>>
>>>>I did some tests last night, replacing my in_check() function with attack
>>>>tables, my thought was that it would be faster, but the result was not that
>>>>good, ok i did a fast hack, scanning the whole board because i dont have piece
>>>>lists, but my previous x-ray in_check function was huge. But now im wondering if
>>>>attack tables (implemented with piece lists) are that much better than x-ray.
>>>>
>>>>You have to check all pieces, = 8 pieces (king checks).
>>>>You have to check if pawns are promoted...  = x pieces.
>>>>Check two squares in front of the king.
>>>>
>>>>And of course, sometimes you have to do some tracing.. (sliding pieces).
>>>>In the opening, middlegame there are usually pieces near the king, so the x-ray
>>>>based in_check only has to trace a few directions.
>>>>This got me thinking that the difference between the two isn't so big, am i
>>>>correct? maybe attacks are a few % faster?
>>>
>>>Hi,
>>>
>>>my in check is also a time consuming process. But is it absolutely necessery?
>>>Maybe it is possible not to check for check at all and just check if a capture
>>>removes the king one ply later. I have not tried this idea but maybe it is
>>>faster then using an in check.
>>>
>>>Also i'am thinking of implementing attack tables in my 0x88 program but i have
>>>not found a fast approach. Ant tips?>
>>>
>>>regards
>>>
>>>Jan Willem
>>
>>In most cases you can use the last move to verify
>>that the king is not in check.
>>
>>If the black king is at e8 and the last move of white
>>is a2-a3 then the king is not in check
>>because both a2 and a3 are not in queen direction or knight direction
>>from the king.
>>
>>It is only one example.
>>
>>I do not do it in that way because I have attack tables
>>for every square but if people are interested in something
>>simple to detect if the king is in check then using
>>the last move is the most simple idea.
>>
>>Uri
>
>Uri, what is the name of your program? where can i download it?

Movei

You can download it together with all the winboard programs
at the site of leo

http://wbec-ridderkerk.nl/

info M-Z

You can get there 2 versions that are not the latest version but I believe
that they will be strong enough for your program.

>How have you implemented in_check() with attack tables? and is it really that
>much faster than tracing?

I never have something else to compare.
I started with attack tables that were generated very slowly only to improve the
speed of generating them.

Finding if the king is in check is very fast for me but the main advantage of
attack tables is not for this purpose.

If you want attack tables only to detect if the king is in check then it is a
bad idea because updating the attack tables between moves takes time.

The reason that I generated my attack tables is not speed in nodes per second.

The point is that I earn a lot of information that can help me to get better
search rules and better evaluation.

Uri



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.