Skip to content

Rules

Give each move one place to check whether it is legal: whose turn it is, whether the piece is available, and whether the target is allowed. Both a human client and an AI adapter should call the same game logic. Listing legal moves in the UI is useful, but the code that applies a move must still validate it before writing.

Use an action handler to validate inputs and change Engine-managed state. For follow-up effects such as scoring or advancing a phase, the Rule Engine can listen for actions and run a condition and sequence. It is not a substitute for checking the original move.