A unicellular walker controlled by a microtubule-based finite-state machine