My first assignment I will adapt (plagiarize is such a nasty word) from an online robotics course I took through Montana State University-Bozeman using Lego Mindstorms robot kits. The course had some NASA support so I think the idea is fair game. The script is that NASA has landed a small rover on Mars. The small rover is assigned the task of removing rocks from a field for a larger ship to land on. The simulated field is the size of a 4X4 sheet of plywood and the rocks are shaped exactly like empty aluminum pop cans. The plywood has a strip of black tape about 3 inches from the edge as the boundary of the field. The trick is to remove the cans from the field without leaving the field (which results in falling off the table the plywood is on.) Having the plywood on the table is sort of critical, it is necessary to have the cans fall out of sight or the robot will keep pushing them. These are not smart robots. The Lego robot has two common languages, NXT-G, an icon based language that comes with the kit, and RobotC, a not-free, C based language I happen to have some licenses for. Supposedly the robot can also be controlled by VB.net, VPL and C#. I have seen code samples and I do not want to commit the time needed to go from “huh?” to “ah ha!”. The trick here is to have the kids work on the logic required to accomplish the task before they touch the robot. It will be a war. The scheme is to build the logic, get a feel for the syntax of NXT-G, code something up, give it a try. Give it lots of trys. I love teaching with the robots, they actually do something physical with the code and coding errors get some of the coolest results. (Be sure to catch the robot before it hits the floor, it takes a while to reassemble.) Now some may argue that this trial and error approach may promote “hacking”. No argument here. Every new language I have learned I did by initially hacking, then once I had an idea how it worked I would learn the refinements. (But I still hack a lot.) Once they have the robot working in NXT-G the next assignment will be to get it doing the same thing in RobotC. Can they apply the logic they developed to a new language? Here is where I start sitting a little farther back. If they have a question they have to look at the API, the documentation (yuck) or find a code snippet. At this stage I want them to start finding resources on their own. I will be there to help them decipher documentation. I do not want to evaluate the solution; I want to evaluate searching for the solution. Having only three kids makes this goal fairly easy. After the kids get these working will come the piece-de-resistance, can they do this simulation in Kodu? They have to switch mediums and languages. Does Kodu even have a way of detecting objects at a distance and if not what is a solution? Beats me but I think it will be fun learning and trying.
As a method of teaching a language, the goal of most programming courses, the above plan sort of sucks. (I really could not think of a better word.) But for teaching how to learn a language, to find out what a language can do, to have the logic figured before trying to type code, to not be afraid to tinker in a new language, I think it will work. Luckily I teach at a private school, I am the only one that teaches any advanced programming and nobody pays any attention to what I am doing in my programming class so I can do this kind of stuff.
It is also nice I am writing in my own blog so I can use words like “suck” and “stuff” and mis-spell the heck out of “piece-de-resistance”.