Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Generator

Author: John Lowe

Date: 04:30:44 12/21/02

Go up one level in this thread


On December 21, 2002 at 04:58:20, Uri Blass wrote:

>On December 21, 2002 at 03:36:59, John Lowe wrote:
>
>>On December 21, 2002 at 02:57:48, Uri Blass wrote:
>>
>>>On December 20, 2002 at 23:49:19, John Lowe wrote:
>>>
>>>>When you program castling, you have to checkout the empty squares for attack -
>>>>theres no reason why you couldn't do this in your situation looking "through"
>>>>the king. It seems much more efficient to let the king go there and find it's in
>>>>check.
>>>
>>>
>>>No it is not
>>>
>>>When the king castle I can simply use my attack table to find if the square is
>>>under attack
>>>
>>>When the king is in check I cannot trust them and I need to use some more
>>>complicated algorithm.
>>>
>>>Uri
>>
>>Hi Uri
>>
>>I use two routines for move-list generation - one simply generates peudo-legal
>>moves and the other simultaneously collects info on attacks, defences, pins
>>veiled attacks etc - but both write pseudo-legal moves and live with the
>>consequences later.
>>
>>How expensive (in time) is the generation/updating of an attack table ...... or
>>is it fundamental to your program anyway?
>>
>>John
>
>Here are my times for the initial position on p850
>
>perft 6=119060324
>time=17.25 seconds
>
>Movei need to make more than 5000,000 moves for that target and it always update
>attack tables after making moves.
>
>Uri

I ask the question because I have a horror of collecting too much useless
information.

I notice that you program in "C" so this may or may not be of interest:

My boards are 64 x 8bit arrays e.g.DS:0321 is a2 and DS:0344 is d4 etc.

If I find the square in a board scan - eg if a bishop is defending a piece on d4
I have the immediate very efficient opportunity of saving the information:-

In assembly the target(0344) is in the BX register.

shl ebx,4

gives me 4400 in the bx register

and ES:4400 indexes to an entire page that I can use to store information about
D4 especially it's attackers and defenders but also whether or not it's pinned,
the direction from which it's pinned where it's "pseudo-movelist" is stored - in
case I want to delete it's attacks etc.

shr ebx,4

restores BX to 0344 with scarcely an interruption in the scan.

It had never occurred to me to save attacks on empty squares (except in the
"movelist" where they are time-consuming to retrieve) but I can appreciate your
point about castling.



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.