xeenoon / ChessApp

0 stars 0 forks source link

Optimizations #15

Closed xeenoon closed 2 years ago

xeenoon commented 2 years ago

Added an undo function

Instead of copying boards everywhere, to prepare for algorithmic searching when the chess engine is implemented, move searching has been modified to instead undo and redo moves.

Moves are first made, and the Move() function returns the move data so that the move can be later reverted The old Move() function still exists for enpassant capture checking, but has been renamed to CopyMove()

After moves have been done, they can be undone with bitboard.UndoMove(BoardData)

This actually increased the speed to 75 million nodes a second at depth 7