Trial-and-error learning