Difference between revisions of "Unmake Move"

From Chessprogramming wiki
Jump to: navigation, search
(Created page with "'''Home * Chess * Moves * Unmake Move''' '''Unmake Move''' is a function inside a chess program to update the internal chess position...")
 
m
Line 1: Line 1:
 
'''[[Main Page|Home]] * [[Chess]] * [[Moves]] * Unmake Move'''
 
'''[[Main Page|Home]] * [[Chess]] * [[Moves]] * Unmake Move'''
  
'''Unmake Move''' is a function inside a chess program to update the internal [[Chess Position|chess position]] and its [[Board Representation|Board representation]] as well as associated or dependent state variables and data by a move unmade on the internal board. In unmake move, reversible aspects of a position can be [[Incremental Updates|incrementally updated]] by the [https://en.wikipedia.org/wiki/Inverse_function inverse] or [https://en.wikipedia.org/wiki/Involution_%28mathematics%29 own inverse] operation of [[Make Move]]. Irreversible aspects of a position, such as [[En passant|ep state]], [[Castling rights|castling rights]] and the [[Halfmove Clock|halfmove clock]] are either restored from a [[Stack|stack]] ([https://en.wikipedia.org/wiki/LIFO_%28computing%29 LIFO]), or simply kept in arrays indexed by current search or game [[Ply|ply]]. Alternatively, one may capacitate the move with all the necessary information to recover those irreversible aspects of a position as well.
+
'''Unmake Move''' is a function inside a chess program to update the internal [[Chess Position|chess position]] and its [[Board Representation|Board representation]] as well as associated or dependent state variables and data by a move unmade on the internal board. In unmake move, reversible aspects of a position can be [[Incremental Updates|incrementally updated]] by the [https://en.wikipedia.org/wiki/Inverse_function inverse] or [https://en.wikipedia.org/wiki/Involution_%28mathematics%29 own inverse] operation of [[Make Move]]. Irreversible aspects of a position, such as [[En passant|ep state]], [[Castling Rights|castling rights]] and the [[Halfmove Clock|halfmove clock]] are either restored from a [[Stack|stack]] ([https://en.wikipedia.org/wiki/LIFO_%28computing%29 LIFO]), or simply kept in arrays indexed by current search or game [[Ply|ply]]. Alternatively, one may capacitate the move with all the necessary information to recover those irreversible aspects of a position as well.
  
 
=Negamax=
 
=Negamax=

Revision as of 21:39, 15 May 2018

Home * Chess * Moves * Unmake Move

Unmake Move is a function inside a chess program to update the internal chess position and its Board representation as well as associated or dependent state variables and data by a move unmade on the internal board. In unmake move, reversible aspects of a position can be incrementally updated by the inverse or own inverse operation of Make Move. Irreversible aspects of a position, such as ep state, castling rights and the halfmove clock are either restored from a stack (LIFO), or simply kept in arrays indexed by current search or game ply. Alternatively, one may capacitate the move with all the necessary information to recover those irreversible aspects of a position as well.

Negamax

This is how make and Unmake Move are applied inside a recursive search routine, for simplicity Negamax:

int negaMax( int depth ) {
    if ( depth == 0 ) return evaluate();
    int max = -oo;
    generateMoves(...);
    while ( m = getNextMove(...) )  {
        makeMove(m); 
        score = -negaMax( depth - 1 );
        unmakeMove(m); 
        if( score > max )
            max = score;
    }
    return max;
}

See also

Forum Posts

1999

2000 ...

2005 ...

2010 ...

2015 ...

Up one Level