This project demonstrates a simple state machine implementation using Go, with recursive state transitions based on input signals.
The core of the project is a function called stateMachine
, which processes two types of input signals (Input1
and Input2
) and transitions between states. The output is emitted as a response to the signals, with the state being updated at each step.
- State: Tracks the current state of the system.
- Input1 / Input2: Input signals that trigger state transitions.
- Output1: Output signal emitted after a state transition.
- stateMachine: Recursively processes inputs, updates the state, and generates outputs.
- collectOutputSignals: Collects and prints output signals for display purposes.
- Run the
main.go
file to see the state machine in action.
go run main.go
- Run the tests.
go test