Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Promotion frequency

Author: Russell Reagan

Date: 23:30:10 07/22/02

Go up one level in this thread


On July 23, 2002 at 02:20:04, Dann Corbit wrote:

>Ultra-simplified example of what I am thinking...
>
>// Construct a list of legal moves, ordered by goodness approximation...
>CurrentPosition.MakeMoveList();
>for (i = 0; i < CurrentPosition.GetLegalMoveCount(); i++)
>{
>   CurrentPosition.MakeMove(i);
>   score = CurrentPosition.Evaluate();
>   CurrentPosition.UnMakeMove(i);
>   /* etc. ... */
>}
>
>Or whatever.  I don't see much value in making decisions about what is moving
>except in the move ordering and evalutation phases.  And in those cases, I will
>be using piece lists {by type} instead of branches anyway.  A bitboard for a
>type/color combination can easily be used as a piece list, for instance.

Do you have a 3D array like:

Piece pieces[NUM_SIDES][NUM_PIECE_TYPES][MAX_PIECES];

I've seen that somewhere before. Maybe EXChess?

So in your make move function, how do you correctly update the position
information if you don't know what kind of move you are doing? Do you only store
the source and destination indexes and then test in the make/unmake move
functions, for example, instead of:

if (move.type == CASTLE)
    // make the castling move and update the castling rights

you would do something like:

if (squares[move.from] == E1 && squares[move.to] == G1 && squares[E1].piece ==
WHITE_KING)
    // make the castling move and update the castling rights

I think even if you can get rid of having to save the move type in your move
structure that you will have to save the piece you are promoting to in a
promotion since if you only give it indexes it won't know what to promote to.

Russell



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.