You are using classical definitions, which matches what I have been describing exactly. Unfortunately, the stockfish case is not a copy/make example, contrary to what was originally stated, because the undo_move() in stockfish actually undoes the move on the board, rather than just backing up to the previous state.Harald wrote:As I understand this dicussion there are basically 2 methods:
("copy-make") We have an array or stack of positions.
make_move(): copy the position infos from ply to ply+1 and change the copy. ply++
undo_move(): ply--
("make-undo") We have only one position.
make_move(): store some parts in a stack. change the position. ply++
undo_move(): ply--; change the position. retrieve some parts.
what a pain to have discussions when the terms are not used with accurate definitions.
In my engine Elephant I use copy-make but that will probably change in the next version.
There is a question related to make-undo:
Does it make sense to do some extra work in make_move() and store
all changes in an undo stack in a simplified form
list< pair<address, old_value> > ?
The undo_move() function does not have to look at the move and
find out what to change. It simply does something like this:
while (list not empty) { *address = old_value; }
(You dont have to use std::list. It is just pseudo code.)
Harald