Simple programmable toy?

Please use code tags when posting code, so that it doesn't degenerate into italics.