import { bitboardMoves, makeMove, startingBitboard, unmakeMove } from '@datamoc/mwg/board';
const board = startingBitboard();
const move = bitboardMoves(board)[0];
const undo = makeMove(board, move);
unmakeMove(board, move, undo);
console.log(board.turn, bitboardMoves(board).length); // 'white' 20 - taken back whole
Takes back exactly what
makeMoveplayed: the mover returns, the taken piece (or the en passant pawn behind the landing square) is restored, and rights, en passant square, halfmove clock and king square come back from the undo.