Back when I was at school, I remember tinkering with a Mac game where you programmed little robots in a sort of pseudo-assembler language which could then battle each other. They could move themselves around the arena, look for opponents in different directions, and fire some sort of weapon. Pretty basic stuff, but I remember it quite fondly, even if I can't remember the name.
Are there any good modern day equivalents?
Core Wars
Planetwars is a game specifically written for Google Ai Contest, bots are controlling fleets for conquering planets, they support many languages
I like Ruby Warrior. It is still somewhat under development, but it is a great game with a clever interface.
Carnage Heart for PlayStation was fun. It would let you program little mechs to do battle using a flow diagram.
http://www.pythonchallenge.com/
highly addictive, and a great way to learn python
I think the original game was called Core Wars (this Wikipedia article contains a lot of interesting links); there still seem to be programs and competitions around, for example at corewars.org. I never had the time to look into these games, but they seem like great fun.