Some of my earliest motivation to learn programming was to build games. That proved too challenging to learn very quickly, but I had great fun drawing things on the screen and making the PC speaker play music (simulating polyphonic sound by switching between notes very quickly).<p>Seeing the results pop up on the screen was certainly a highly-motivating factor (and satisfaction with text results from algorithms came later ;-) )