Gates › Control Flow › Counter

Counter

Exec gate Control Flow 3 in 3 out 1 config ⬚ 1x1

Increase advances the saved Output through 0 to Count minus 1 and wraps to 0. Decrease moves the other way and wraps to Count minus 1.

Diagram

Ports drawn from the source data: inputs left, outputs right, config inside.

How it's used

Keeps a number that steps up (or down) each time it gets a pulse, wrapping back to 0 at the top. The backbone of step-sequences and multi-state switches.

Count button presses, wrapping at 4

  1. Place a Button and a Counter gate.
  2. Set the Counter's Count property to 4 (it will output 0,1,2,3 then wrap to 0).
  3. Wire the Button's press output → the Counter's Increase (Exec) input.
  4. The Counter's Output now steps 0→1→2→3→0… on each press.

Documented: Output advances 0..Count-1 and wraps. The Counter also has a Decrease (Exec Down) input to step backward. Exact button output port name varies by button type — verify in-game.

Place the gates and drag wires between the named ports. Port names come from the gate catalog; behavior is documented, not independently tested — confirm in-game.

Technical details — ports, config & source

Wire inputs

Wires you feed into the gate.

Display name Type Tooltip
Count int No tooltip in source
Exec exec No tooltip in source
Exec Down (ExecDown) exec No tooltip in source

Wire outputs

Wires the gate produces.

Display name Type Tooltip
Exec Out (ExecOut) exec No tooltip in source
Exec Out Down (ExecOutDown) exec No tooltip in source
Output int No tooltip in source

Configuration properties

Set on the gate itself in its properties panel — not wired. Distinct from inputs.

Display name Type Tooltip
Value int No tooltip in source

Source details

Brick asset
B_1x1_Gate_Exec_Cycle
Component class
BrickComponentType_Exec_Cycle
Kind
exec
Family
—
Search tags
cycle counter count increment increase decrement decrease wrap index
Half size
5 × 5 × 2

From logic_gate_inventory.simple.json @ 9660107. Documented behavior, not independently tested.