A cut-and-paste model which mimics a trial-and-error process of adaptation is introduced and solved. The model, which can be thought of as a diffusion process with memory, is characterized by two properties, efficiency and persistence. We establish a link between these properties and determine two transitions for each property, a percolation transition and a depinning transition. If the adaptation process is iterated, the antipersistent state becomes an attractor of the dynamics. Extensions to higher dimensions are briefly discussed.