Hunt down an oldish game called Colobot. Windows only game. Its a typical "world exploration" game but with one very interesting addition.
You can either control the myriad of robots manually, OR... program in a very C++-like language and let them "have at it".
The game encourages code re-use, so once you've coded a particular operation, you're encouraged to re-use it for subsequent levels.
One of the most fun coding experiences I've ever had.