Changes

Jump to: navigation, search

Unmake Move

4,502 bytes added, 10:17, 13 May 2018
Created page with "'''Home * Chess * Moves * Unmake Move''' '''Unmake Move''' is a function inside a chess program to update the internal chess position..."
'''[[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.

=Negamax=
This is how [[Make Move|make]] and Unmake Move are applied inside a [[Recursion|recursive]] search routine, for simplicity [[Negamax]]:
<pre>
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;
}
</pre>

=See also=
* [[General Setwise Operations#UpdateByMove|Bitboard Update By Move]]
* [[Copy-Make]]
* [[Encoding Moves]]
* [[Incremental Updates]]
* [[Make Move]]
* [[Piece-Lists#Unmake|Piece-List Update by Unmake Move]]

=Forum Posts=
==1999==
* [https://www.stmintz.com/ccc/index.php?id=40653 Unmake move v copy the board] by Hugh Cumper, [[CCC]], January 24, 1999
==2000 ...==
* [http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/64f953b94ae312b Does Unmake Move Really Save Time?] by Adrian Jackson, [[Computer Chess Forums|rgcc]], March 08, 2001
* [http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/f5e2343c99ae6388 UnMakeMove] by Orhan Öztürk, [[Computer Chess Forums|rgcc]], December 09, 2002
* [https://www.stmintz.com/ccc/index.php?id=286582 Why have a UnMakeMove or UndoMove function (not as stupid as it sounds)?] by [[Albert Bertilsson]], [[CCC]], February 24, 2003 » [[Sharper]]
* [https://www.stmintz.com/ccc/index.php?id=312031 The need to unmake move] by [[Mathieu Pagé]], [[CCC]], August 19, 2003
==2005 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=13764 doing undoing] by [[Fritz Reul]], [[CCC]], May 14, 2007
* [http://www.talkchess.com/forum/viewtopic.php?t=19214 implementation of undoMove()?] by cyberfish, [[CCC]], January 26, 2008
* [http://www.open-aurec.com/wbforum/viewtopic.php?f=4&t=4641 make/unmake] by [[Robert Pope]], [[Computer Chess Forums|Winboard Forum]], April 08, 2006 » [[Beaches]]
* [http://www.talkchess.com/forum/viewtopic.php?t=29770 undo move vs. Position Cloning] by BoldReceiver, [[CCC]], September 16, 2009
* [http://www.talkchess.com/forum/viewtopic.php?t=29798 copy/make vs make/unmake test results] by [[Robert Hyatt]], [[CCC]], September 19, 2009 » [[Crafty]]
==2010 ...==
* [http://www.open-chess.org/viewtopic.php?f=5&t=665 Copy Board vs Unmake Move] by ChrisJ, [[Computer Chess Forums|OpenChess Forum]], September 29, 2010
* [http://www.talkchess.com/forum/viewtopic.php?t=39938 performance of copy-make] by [[Rein Halbersma]], [[CCC]], August 02, 2011
* [http://www.talkchess.com/forum/viewtopic.php?t=47882 How costly is taking moves back ?] by [[Piotr Lopusiewicz]], [[CCC]], April 30, 2013
* [http://www.talkchess.com/forum/viewtopic.php?t=50805 copy/make vs make/unmake] by [[Robert Hyatt]], [[CCC]], January 07, 2014
* [http://www.talkchess.com/forum/viewtopic.php?t=53502 Memory usage in make/unmake vs logic complexity] by [[Matthew Lai]], [[CCC]], August 30, 2014
==2015 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=58647 Unifying make/undo and copy-make] by [[Rein Halbersma]], [[CCC]], December 21, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=62090 Copy-make vs Make/Unmake ?] by [[Mahmoud Uthman]], [[CCC]], November 12, 2016
* [http://www.open-aurec.com/wbforum/viewtopic.php?f=4&t=53892 Is Unmake Move truly necessary?] by SethCS, [[Computer Chess Forums|Winboard Forum]], May 18, 2017

'''[[Moves|Up one Level]]'''

Navigation menu