Can Games Teach You To Program?
After getting severely distracted by a little gem called RoboZZle I’d had to answer with a solid maybe. The idea behind the game is simple: for each puzzle, program a small robot to collect all of the stars without falling off the map. Here’s a an example of a typical puzzle:
What’s really cool is that the author, Igor Ostrovsky, has added social features so if you sign up for an account you can rate and vote for puzzles as well as submitting your own. This frees Igor from having to dream up all the puzzles and adds a lot more variety and a lot more devious minds the mix!
No modern programming language looks anything like the one used in the game, at least, not one anyone uses… so what could it possibly have to teach us? Well, solving all of the puzzles will require you to do all of these:
- Search for patterns.
- Invent algorithms.
- Create reusable functions.
- Understand recursion.
There’s one item in that list that is essential for solving many of the harder problems, and it’s one that still gives a lot programmers headaches in the real world…
A function that calls itself, what’s so hard about that? If you think you really understand recursion here’s some puzzles to try, starting with something nice and easy and working up to trickier problems:
Made it this far? Well done. As a final exam I put together a puzzle of my own. At the time of writing is remains unsolved, let me know how you get on…
So yes, maybe there is something games can teach us. If so I’m going to be a genius! Oh yeah, the game is built in Silverlight too which is just awesome.