turing_step = () => {
  state_key = machine.state + '/' + tape[machine.pos]
  any_key = machine.state + '/any'
  action_items = states[state_key] || states[any_key]
  functions = action_items[0]
  next = action_items[1]
  functions.forEach(f => f())
  machine.state = next
}

dump = () => console.log('tape', tape, ', machine', machine)

turing_run = (n) => {
  for (i = 0; i < n; i++) {
    turing_step()
    dump()
  }
}
