Unmake Move

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=
 * Bitboard Update By Move
 * Copy-Make
 * Encoding Moves
 * Incremental Updates
 * Make Move
 * Piece-List Update by Unmake Move

=Forum Posts=

1999

 * Unmake move v copy the board by Hugh Cumper, CCC, January 24, 1999
 * Move Make/Unmake Questions by Daniel Homan, CCC, July 15, 1999

2000 ...

 * Does Unmake Move Really Save Time? by Adrian Jackson, rgcc, March 08, 2001
 * UnMakeMove by Orhan Öztürk, rgcc, December 09, 2002
 * Why have a UnMakeMove or UndoMove function (not as stupid as it sounds)? by Albert Bertilsson, CCC, February 24, 2003 » Sharper
 * The need to unmake move by Mathieu Pagé, CCC, August 19, 2003

2005 ...

 * doing undoing by Fritz Reul, CCC, May 14, 2007
 * implementation of undoMove? by cyberfish, CCC, January 26, 2008
 * make/unmake by Robert Pope, Winboard Forum, April 08, 2006 » Beaches
 * undo move vs. Position Cloning by BoldReceiver, CCC, September 16, 2009
 * copy/make vs make/unmake test results by Robert Hyatt, CCC, September 19, 2009 » Crafty

2010 ...

 * Copy Board vs Unmake Move by ChrisJ, OpenChess Forum, September 29, 2010
 * performance of copy-make by Rein Halbersma, CCC, August 02, 2011
 * make and unmake stadistics by Fermin Serrano, CCC, February 28, 2012 » Search Statistics
 * Saving info before making a move by CDaley11, OpenChess Forum, December 30, 2013 » Make Move
 * How costly is taking moves back ? by Piotr Lopusiewicz, CCC, April 30, 2013
 * copy/make vs make/unmake by Robert Hyatt, CCC, January 07, 2014
 * Memory usage in make/unmake vs logic complexity by Matthew Lai, CCC, August 30, 2014

2015 ...

 * Unifying make/undo and copy-make by Rein Halbersma, CCC, December 21, 2015
 * Copy-make vs Make/Unmake ? by Mahmoud Uthman, CCC, November 12, 2016
 * Is Unmake Move truly necessary? by SethCS, Winboard Forum, May 18, 2017

Up one Level