How to Learn a Program? We will discuss novel ways of making robots and other agents smarter through machine learning algorithms. The focus will be on sequence learning as opposed to conventional pattern recognition. We will outline very general, asymptotically optimal problem solvers pioneered in our lab, as well as practical applications based on state-of-the-art adaptive feedback neural networks, with examples ranging from challenging control tasks to handwriting recognition and music composition.