State Diagram
FSM Type: Moore Machine
In a Moore machine, the output depends only on the current state,
not on the input. Notice how each state has a fixed output label (LOCKED or UNLOCKED).
Input
_ _ _
🔒 LOCKED
Secret code: 1-2-3
Current State
S0 — Waiting for first digit. Enter '1' to begin.
| State | Meaning | Output |
|---|---|---|
| S0 | Initial / 0 correct | LOCKED |
| S1 | Got '1' | LOCKED |
| S2 | Got '1-2' | LOCKED |
| S3 | Got '1-2-3' ✓ | UNLOCKED |
Transition Log
System ready. Enter code: 1-2-3