[Community Puzzle] Cooperative Mate with Rook

Thanks, so you are starting with every combination of the board as nodes as opposed to adding nodes to represent the board position as pieces move around. I assume between each node (board), you create a list of possible other boards from that position.
What is a “state” in your description?

Thanks darkhorse64, if I understand correct, your node is a hash of the 3 piece positions and you never visit that more than once? Are you also pre-calculating the boards ahead of time or are you generating them at runtime?

My hash also contains the player color (very important !). I have not precalculated anything.

The idea to start with the terminal states (mate positions) is a result from the 2nd puzzle “Adversarial mate with rooks”. It won’t simplify things here.
Hashing to detect duplicate states is totally sufficient for this puzzle.

Position of each piece, player to move next.

Thankyou both, I looked at this again today and got it working. I switched to hashing the board state and also avoiding a time out by pruning the possible rook moves to two (a mate is only possible when the king is on an outside rank).
This was a great puzzle and it remains to be seen if this implementation can be applied to the adversarial mate puzzle, hopefully that one has a longer timeout! :slight_smile: