bowling game modeled as a state machine