The Castle Gate Defense
When the MOAT is full and the RAIN falls, the GATE remains closed. The GATE opens only if the BRIDGE is down and either the MOAT is empty or it is not raining.
Replay this puzzle All puzzles
The truth table
Inputs on the left, the output on the right. A circuit solves the puzzle when it reproduces every row.
| MOAT | RAIN | BRIDGE | GATE |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 |
What the table tells you
- GATE is 1 in 3 of the 8 rows. Every input matters: for each one there is a row where flipping it changes GATE. The rows that turn it on: MOAT=0, RAIN=0, BRIDGE=1; MOAT=0, RAIN=1, BRIDGE=1; MOAT=1, RAIN=0, BRIDGE=1.
The smallest known circuit: 3 gates
As a formula, one line per output:
GATE = (BRIDGE AND (NOT MOAT OR NOT RAIN))
As a netlist, in the order you would wire it. Each g is one gate; the last line says which signal drives the output.
g1 = MOAT AND RAINg2 = NOT g1g3 = BRIDGE AND g2GATE = g3
The search checked every circuit with fewer gates and none matches the table, so 3 is the true minimum for the allowed gate set. Gates that do not feed an output are never counted.
Leaderboard for the day
Nobody posted a result on the day. The circuit above is the reference.
← #36 The Dragon Guard Alert · #38 The Greenhouse Frost Alert →