- let next state ~burning_neighbors =
- match state, burning_neighbors with
- | State.E, _ when is_probable p -> State.T
- | State.E, _ -> State.E
- | State.T, 0 when is_probable f -> State.B
- | State.T, _ when burning_neighbors > 0 -> State.B
- | State.T, _ -> State.T
- | State.B, _ -> State.E