Efficient Minimax chess engine in Haskell

Viewed 160

For the sake of the conversation I would rather implement Minimax and not Alpha-beta or any other algorithm.

I implemented this already in OOP fashion (CPP). Instead of having the Minimax tree nodes to be entire deep-clones of the board, I found out it is more efficient the edges are just deltas between boards (an interface that allows Do() and Undo() on a board) and the board state is calculated on the fly.

When I travel through the tree I apply these Deltas' on my one and only instance of the board.

How should I address this in functional-programming immutable style? Cloning the entire board every time was definitely slower than just changing one instance of the board.

I'm new to functional programming and I'm still trying to get my head around this way of thinking.

0 Answers
Related