State Machine
So the events if you triggered them around the circle look like this (latest on top)
{
"events": [
{ "action": "T4", "state": [ 1, 2, 0, 0, 0 ] },
{ "action": "T3", "state": [ 0, 1, 0, 1, 0 ] },
{ "action": "T2", "state": [ 0, 1, 1, 0, 0 ] },
{ "action": "T1", "state": [ 0, 1, 0, 0, 1 ] },
{ "action": "T4", "state": [ 1, 1, 0, 0, 0 ] },
{ "action": "T3", "state": [ 0, 0, 0, 1, 0 ] },
{ "action": "T2", "state": [ 0, 0, 1, 0, 0 ] },
{ "action": "T1", "state": [ 0, 0, 0, 0, 1 ] }
],
}