title: State machine: Use transition matrix instead of nested switch cases C++
body: <p>I am having difficulties with my state machine. I use a function that returns the new state based on input parameters oldState and two input parameters.</p>
  
  <p>In this function I have a lot of nested switch cases. I'd rather use a 2x2 transition matrix but have no idea how to use it. I did make a transition table from the state diagram with sates and inputs.</p>
  
  <p>But how exaclty do I use the 2 dim. array <code>transition_table[3][4]</code>?</p>