is it possible to have a variable amount of elifs in an if/elif/else chain?

Solution 1:

Building upon @Mark's comment, you may make a dict whose keys are (state, change) tuples and whose values are the functions you will call:

things = {(0,0) : something00, (0,1) : something01, ..., (3,3) : something33}
change = <code to find the change>
things[(state, change)]() ##calls one of the <somethingXX> functions