Author: Andreas Guettinger
Date: 08:14:37 02/21/04
Go up one level in this thread
On February 21, 2004 at 04:09:22, Mathieu Pagé wrote:
>Hi,
>
>This is my move structure:
>
>class CCoup{
> char tcCoup; // type of move castling promotion (the piece)
> unsigned char cPiecePrisePieceJoue; // type of the piece moved and on the
> // piece taken if any.
>
> int iFrom; // self explaning
> int iTo; // ditto
>
>...
>};
>
>It is 10 bytes long. is it common to have a move struct that "big" ?
>
>from and to could be compress to one byte each, but i Think (i'm not sure) it
>would be less efficient since I often have to use them as a table index and a
>table index is always (on my target architecture) 4 bytes.
>
>Am I right ? What do you think of it ?
>
>Mathieu P.
I have a move structure for storing move properties:
struct move_t
{
square_t from;
square_t to;
special_t movetype;
fig_t promotion;
fig_t movingfig;
fig_t capturedfig;
int sval;
};
I think its also 10 bytes big.
I never compared it to the other representation in one num, but I don't see
whats so bad about it. I get resonable nps im my perft.
In big functions I make local copies of the structure elements for easier
access.
square_t iFrom = move[i].from;
square_t iTo = move[i].to;
etc.
regards
Andy
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.