code: func (a *Automaton) addTransitionRange(source, dest, min, max int) {
  	assert(len(a.transitions)%3 == 0)
  	assert2(source < a.numStates(), "source=%v is out of bounds (maxState is %v)", source, a.numStates()-1)
  	assert2(dest < a.numStates(), "dest=%v is out of bounds (maxState is %v)", dest, a.numStates()-1)
  
  	if a.curState != source {
  		if a.curState != -1 {
  			a.finishCurrentState()
  		}
  
  		// move to next source:
  		a.curState = source
  		assert2(a.states[2*a.curState] == -1, "from state (%v) already had transitions added", source)
  		assert(a.states[2*a.curState+1] == 0)
  		a.states[2*a.curState] = len(a.transitions)
  	}
  
  	a.transitions = append(a.transitions, dest, min, max)
  
  	// increment transition count for this state
  	a.states[2*a.curState+1]++
  }
docs: /* Add a new transition with the specified source, dest, min, max. */