With the catchall in place, all we need to do from now on is define the positive cases. We’ll add a new clause of check/2 for each new state/event pair that we want to add to the whitelist. By the end of this section, we will have a complete state machine that will describe all the rules of Islands.
Let’s start with the first state, :initialized.
When we’re in :initialized, the only permissible action is adding the second player. We’re going to focus on that one action and the transition it triggers, from :initialized to :players_set.
We’ll need a clause of check/2 for this that adds this combination of state ...