Nowadays they use Scratch for this in schools, also with some "games" where you need to make a program so that your squirrel visits squares in order and the like. My daughter was able to understand basic programming principles and succesfully make programs, she just doesn't want to continue doing that. I was "initiated" also with small game-like programs in Amos on Amiga. Learning programming by making something move on screen (or a robot on desk) is probably the best way to catch children's attention.