Vectors must be OPPOSITE0º ↔ 180º (vertical axis)90º ↔ 270º (horizontal axis)Destination MUST be empty
1
Part 1: Game Physics (Caps i Caps)
PHYSICS
The Board (R/L Rule)
The board consists of X Columns and Y Rows. The first tile P11 is the bottom-left corner. X increases to the right, Y increases upwards.
-- Tile classification --
Type R → x+y is EVEN
Type L → x+y is ODD
Obstacle → Cannot hold Gears
Unified Rotation Principle:
Rotating ANY gear propagates rotation to the entire connected network.
+90º applied to any gear:
All same-type gears → rotate +90º (Counter-Clockwise)
All opposite-type → rotate -90º (Clockwise)
Levels (difficulty):
Level 1 (3x3) | Level 2 (4x4) | Level 3 (5x5)
Level 4 (6x6) | Level 5 (7x7) | Level 6 (8x8) | Level 7 (10x10)
Gear Types and Inventory
Type
Bases
Orientations
Initial Code
G1
1 Base
0°
B0222
G2
2 Opposite
0°, 180°
B0202
G3
3 "T" shape
90°, 180°, 270°
B2000
G4
4 Full Cross
0°, 90°, 180°, 270°
B0000
💡 Bxxxx Encoding: 4-digit code for orientations 0°/90°/180°/270°.
0 = base exists and is EMPTY |
1 = base occupied by a MOUSE |
2 = NO base at this orientation
Placement Rules and Game Phases
Placement conditions (strict):
1. First gear MUST be in row y=1
2. Subsequent gears MUST be adjacent to an existing one
3. Choose initial rotation 'b' BEFORE applying the ±90° turn
PHASE 1 — PLACEMENT (while inventory > 0):
ALL moves must place a gear.
Syntax: G<Type>@P<XY>(b=0...3)<Turn>
Example: G4@P12(b=2)-90
PHASE 2 — ROTATION (when inventory = 0):
Simple: G@P<XY><Turn>
Example: G@P22+90
Pre-Move: G@P<XY>:b=<N> ; G@P<XY><Turn>
Example: G@P13:b=1 ; G@P21+90
(adjust b on one gear, then rotate another — can serve different mice)
Turn direction:
+90° = Counter-Clockwise (Left)
-90° = Clockwise (Right)
Mice Physics and Scoring
⚠️ CRITICAL TIMING RULE: Jumps occur IMMEDIATELY AFTER the turn, EXCEPT Entry Jumps (Row 1), which occur BEFORE the turn.
-- Scoring --
0° → 180° (Up) +10 pts
180° → 0° (Down) -10 pts
90° → 270° (Left) +5 pts
270° → 90° (Right) +5 pts
Board Exit (rescued) +10 pts
-- Special Case: Entry Jump (Row y=1) --
1. Gear placed with initial rotation 'b'
2. CHECK: empty base pointing 180° (Down)?
3. IF YES → mouse enters IMMEDIATELY (0 pts)
4. AFTER → turn (±90°) is applied
-- Conflict Resolution --
Two mice CAN jump simultaneously to the same gear
if they land on DIFFERENT bases.
2
Part 2: Reading the Board State
BOARD READING
The AI does not see the board visually — it reads a symbolic JSON representation. If you are building a Custom Agent (Option C), this is what your script receives.
Board Encoding — How to read a tile
-- Tile formats --"P13": "P13R"→ Empty tile, Type R"P22": "obstacle"→ Blocked tile"P32": "G3P32L3B2001"→ Gear on tile ↑ ↑ ↑↑ ↑
│ │ ││ └── Bxxxx state
│ │ │└─── rotation b (0-3)
│ │ └──── R or L type
│ └─────── tile coordinate
└────────── Gear type (G1-G4)
Mice States
Status
Meaning
on_base value
WAITING
Not yet on board
null
IN_PLAY
On the board
0=Up | 1=Left | 2=Down | 3=Right
ESCAPED
Rescued — game objective
null
3
Part 3: Entropy Protocol (Anti-Memorization)
ANTI-OVERFITTING
⚠️ A pre-calculated or memorized move sequence WILL FAIL if the agent executes it blindly without re-reading the board.
-- Purpose --
Prevents memorizing the level solution (overfitting).
-- Trigger --
When the board is full (inventory = 0), the system activates
an Entropy Event automatically.
-- Effect --
Random permutation of gears in the second-to-last row
AND their rotation (b: 0...3) is randomized.
-- What it looks like in history --"[EVENT] ⚠️ TOTAL ENTROPY: P32->P12(b=0), P12->P32(b=2)"-- Required response --
If [EVENT] ⚠️ detected in history:
→ Physical state has changed forcibly
→ MUST re-read board_encoding
→ MUST re-calculate strategy from scratch
4
Part 4: Strategic Reasoning Principles
STRATEGY
Hierarchical Decision Tree — apply in strict order
Priority
Name
What to look for
1
Win NOW?
Move that makes a mouse leave the board immediately (+10 pts exit).
2
Reach Exit?
Place a mouse in the last row (exit row) this turn.
3
Clear Advance?
Move a mouse to a higher row (y+1) or bring a new mouse onto the board.
4
Strategic Maneuver?
No direct advance possible — prepare terrain, break a block, improve position.
5
Pre-Move (Full Board)?
Inventory = 0 only. Modify 'b' of a gear before rotating to set up multi-turn combos.
6
Local Maxima?
Before confirming: could a different move save 2 mice instead of 1?
7
Placement Strategy?
Phase 1 only: think about future rotations when placing each gear.
Case 1 (Vector 270°):
P21 has vector → 270°
Place P22 with empty base at 270°
Effect: rotating P21 +90° aligns them (0° vs 180°) → JUMP created
Case 2 (Vector 90°):
P21 has vector → 90°
Place P22 with empty base at 90°
Effect: rotating P21 -90° aligns them → JUMP created
Case 3 (0°/180° Opposition):
P21 has vector 0° → place P22 with vector 180°
Effect: useful 2 turns ahead
Case 4 (180°/0° Inversion):
P21 has vector 180° → place P22 with vector 0°
Effect: prepares trajectories after complex rotations
Self-Evaluation (before every move):
"Does a lower priority action offer a superior long-term result?"
Example: skip Clear Advance (P3) to prepare a Double Jump next turn.
5
Part 5: Command Syntax Reference
COMMANDS
Command formats — used by the CLI and Custom Agents
PHASE 1 — Placement (inventory > 0):
Format: G<Type>@P<XY>(b=<InitRot>)<Turn>
Example: G2@P21(b=0)+90
Meaning: Place G2 at P21, base 0 pointing North, rotate +90° CCW.
PHASE 2 — Simple Rotation (inventory = 0):
Format: G@P<XY><Turn>
Example: G@P11-90
Meaning: Rotate gear at P11 -90° (clockwise).
PHASE 2 — Rotation with Pre-Move (inventory = 0):
Format: G@P<XY>:b=<N> ; G@P<XY><Turn>
Example: G@P13:b=1 ; G@P21+90
Meaning: Snap P13 to b=1 (90° Left), then rotate P21 +90°.
The two cells can serve DIFFERENT mice.
Validation Rules
✅ CORRECT: "G1@P11+90"
✅ CORRECT: "G@P13:b=1 ; G@P21+90"
❌ INCORRECT: "G1@P11+90 because I want to win" ← Parse Error
❌ INCORRECT: "Move G1 to P11" ← Syntax Error
💡 Reasoning field: Always explain your move using the Priority 1-7 logic. It is stored in the match log and used for Talent Hub evaluation. It does not affect game physics.
🤖 Custom Agent (Option C): Your script receives the full board state via stdin (JSON) and must return {"command": "...", "reasoning": "..."} via stdout. See agent_template.py in your ~/ixentbench/ folder.