Saving castling states and en passant history

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

EricLang

Re: Saving castling states and en passant history

Post by EricLang »

Ok I get it. I changed the code of my chess engine. I do not save any ep status or castle status in any list but do something like the following:
(pseudo delphi code)

Code: Select all

function AlphaBeta(...): Integer;
begin
  Undo := MakeMove(Board, Mov);
  ...
  Result := AlphaBeta(...);
  ...
  UnmakeMove(Board, Mov, Undo);
end;