3. No Way Out
Maze · Intelligence Studio
Recognize dead ends with combined AND conditions and escape to the goal.
Scenario
The maze has a dead-end pocket. A simple turn-right rule loops indefinitely when trapped.
Problem statement
This 7x7 maze introduces a tricky dead end.
Your robot's simple rules know how to walk forward and turn right at corners, but in a dead end surrounded by walls on multiple sides, turning right just spins the robot in circles.
To break out, combine two facts into a specific rule: when there is a wall ahead AND a wall to the right, turn left instead. Place this specific rule above the general turn-right rule so it triggers before the fallback!
General rules like `wallAhead -> pivot-right` fail when trapped because they keep repeating the same turn.
By checking `wallAhead && wallRight`, you create a rule specific to dead ends. Rules are checked top-to-bottom, so specific cases must sit above general fallbacks.
What this teaches
Combine conditions with AND (&&) and order specific rules above general fallbacks.
Active controller
Apply & Run executes only the selected controller.
How a rule works
A rule has two parts:
WHEN <something is true> → DO <this action>
- WHEN is a question about what is happening right now. For example: "Is it raining?" or "Is there a wall ahead?"
- DO is what happens when the answer is yes.
- The simulation runs one step at a time.
- On each step, the rules are checked from top to bottom.
- The first rule that is true wins. The rules below it are skipped for that step.
- To change which rule wins, move it up or down the list.
- If no rule is true, nothing happens on that step.
- Some actions have more than one step, like "turn right, then move". You build these in the Functions tab.
- Once a multi-step action starts, it finishes all its steps before the rules are checked again. It only stops early if the next step is not safe.
See an example
Two rules for deciding about an umbrella:
1 WHEN isRaining → take an umbrella 2 WHEN always → leave the umbrella at home
- It is raining. Rule 1 is true, so you take an umbrella. Rule 2 is skipped.
- It is sunny. Rule 1 is false, so rule 2 is checked next. Rule 2 is always true, so you leave the umbrella at home.
- Order matters. If rule 2 were on top, it would be true every day, and you would never take an umbrella.
Rule folders
Categorise cards without changing their global execution order.
Task progress & pass contractThe exact requirements used to judge this visible run⌄
- Escape the maze and settle on the goalnot run
reached - Solve it with 4 rules or fewerbonusnot run
reached && rules <= 4
Press Apply & Run to load your brain and start the simulation.