Programming a robot to teach itself how to move