Victory Conditions
The game has two distinct win conditions depending on which side achieves their objective first.Mouse Wins
The mouse achieves victory when it reaches the cats’ starting row. Winning condition:- The mouse must reach row 8 (the opposite side of the board)
- It can be on any black square in row 8
- Specifically, any of these positions: (8,1), (8,3), (8,5), or (8,7)
These are the same squares where the cats started the game. The mouse essentially needs to “break through” the cats’ defensive line and reach their home row.
“Gana el ratón si consigue llegar al lado contrario, es decir, a cualquiera de las casillas de las que salieron los gatos.” (The mouse wins if it manages to reach the opposite side, that is, any of the squares from which the cats started.)
Cats Win
The cats achieve victory when they trap the mouse. Winning condition:- The mouse has no legal moves available
- All four diagonal squares adjacent to the mouse are either:
- Occupied by cats
- Outside the board boundaries
- White squares (not playable)
“Ganan los gatos si consiguen atrapar al ratón, de manera que el ratón no pueda moverse más.” (The cats win if they manage to trap the mouse, such that the mouse can no longer move.)
How the Game Ends
Mouse Victory Scenario
If the mouse successfully reaches row 8:- The final board position is displayed
- The game announces the mouse’s victory
- The game session ends
Cat Victory Scenario
When the cats successfully trap the mouse:- The final board position is displayed
- A “Game Over” message is shown
- The game session ends
Understanding Trapped Positions
What Constitutes Being Trapped
A mouse is trapped when all four diagonal directions are blocked: For a mouse at position (row, col), it checks:- Forward-left: (row+1, col-1)
- Forward-right: (row+1, col+1)
- Backward-left: (row-1, col-1)
- Backward-right: (row-1, col+1)
Example Trap Formations
Corner Trap
When the mouse is in a corner, it only needs 2 cats to be trapped:Edge Trap
When the mouse is on an edge but not a corner, it needs 3 blocking positions:Center Trap
When the mouse is in the center of the board, all 4 diagonal squares must be blocked:The AI in this implementation uses sophisticated strategies to force the mouse into trapped positions, achieving a 100% win rate against human players.
Win Detection
The game automatically detects win conditions after each move:After Mouse Moves
The system checks:- Has the mouse reached row 8?
- If yes → Mouse wins
- If no → Cat’s turn begins
After Cat Moves
The system checks:- Does the mouse have any legal moves?
- If no legal moves → Cats win
- If legal moves exist → Mouse’s turn begins
AI Strategy Insights
The CLIPS expert system uses multiple rule-based strategies to trap the mouse:Block Formation (Completar Fila)
Block Formation (Completar Fila)
Cats advance together in a coordinated line, maintaining formation to limit the mouse’s forward progress. The AI identifies which cat should move to maintain an unbroken diagonal barrier.
Semi-Encirclement (Semi-encerrar)
Semi-Encirclement (Semi-encerrar)
When the mouse is positioned between cats, the AI recognizes the opportunity to tighten the trap by moving the appropriate cat closer.
Furthest Cat Advancement (Gato Más Alejado)
Furthest Cat Advancement (Gato Más Alejado)
If a cat is more than 2 columns away from the mouse, it advances diagonally toward the mouse to prevent easy escapes around the flanks.
The source code reveals that the AI evaluates multiple strategies with different priority levels (salience values), ensuring the most effective move is chosen each turn.
Strategic Implications
For the Mouse Player
To have any chance of winning:- Avoid being cornered early in the game
- Create multiple escape routes at all times
- Force cats to spread out rather than maintaining formation
- Use backward moves strategically since cats cannot follow
- Push through gaps in the cat formation before they close
Game Difficulty
According to the source documentation:“El sistema presenta la inteligencia artificial de las piezas de los gatos, de manera que un 100% de las partidas son ganadas por los gatos.” (The system features artificial intelligence for the cat pieces, such that 100% of games are won by the cats.)This makes the game extremely challenging—the AI plays perfectly, so finding a winning path requires exceptional play from the human player.