Back in the days when Apple pretty much owned the educational market, the Mac was new and Oregon Trail was the pinnacle of edutainment, there existed a little program called ChipWits. I played on my Laser 128, but there were versions for the Commodore 64 and Macintosh. Now some 20-odd years later ChipWits makes a triumphant return as an Adobe AIR app, so you can get your robot on with a Windows machine or a Mac (and hopefully Linux someday).
ChipWits is a programmable robot game. You build and program your little robot dude to travel through various environments (called rooms). Each one has specific rewards and risks, which makes programming the robot guy interesting. That may sound dry as toast, but your robot eats pie and drinks coffee. He can see, smell and touch. He can zap bugs but isn't too happy with bombs. The bit of whimsy thrown in with the robot-building makes for a really enjoyable game. Plus, it's surprising how fun debugging your robot can be.
The big improvement in what the authors are calling ChipWits II is that you can now create your own missions. If something like Desktop Tower Defense is your bag, the Mission Editor will appeal to you. Currently you can try ChipWits 15 times and buy it for $14.95. The release price will be $19.95, and the authors are donating 10% of their profits to 3 non-profit organizations.