Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Another question about crbmg.cpp

Author: Sune Fischer

Date: 09:03:48 01/29/04

Go up one level in this thread


On January 29, 2004 at 11:26:01, Maurizio Di Vitto wrote:

>Thanks again for your further help,
>I have another doubt just about a part of your crbmg.cpp. It's about the
>MakeMove. At the begin of this member function we need to know wich piece has
>been moved, and you do it by using the Action() function that shift the m value.
>But from the 13th to the 15th bit of m bitfield we can deduce just the piece
>moved, but in the MakeMove in the switch selection you also control if the value
>is CASTLE, ENPASSANT, TWOFORWARD....

Yes that was the point of the action() bits, if you just have the piece you need
to further do some testing. E.g. if we move a pawn, we still need to check if
this pawn is promoting or moving two forward. The point is that there really is
no need to check for this because we know this already when we generate the
move.

By expanding the action() to classify a few extra special moves we can switch
jump straight to the relevant section without asking questions.

>how do you know these state (CASTLE,
>ENPASSANT...) if the Action() function shift the m value of 12 units? I mean if
>you control from the 13th to the 15th bits you know wich pice has been moved and
>not if is a Castle move. What's wrong in this my exposition?

The action bits gets shifted 22 and AND'ed by 15 AFAICT.

I've found that you need a castle bit when supporting FRC, otherwise if the king
walks from f1 to g1 and still has king side castle rights it will be impossible
to distinguish a normal move from a short castle move (should we also move the
rook?).

-S.

>Thanks again for your help.
>Maurizio Di Vitto



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.