Graph Theory37 sections · 1633 units
Open in Course

Problem - Cat and Mouse (Part 9)

(Turn logic details)

Be careful with the turn indicator. When it is the mouse's turn, the mouse-win condition is "any move leads to a mouse-win". For the cat, it is symmetric. The loss condition is when all moves lead to the opponent winning.

This happens when the degree reaches zero without finding a winning move. Test your code on small examples first. Verify terminal states are detected correctly and propagation works as expected.