How to learn to program – assignment 1, 2 and sort of 3.

This year I will have an odd mix in my “advanced” programming class.  I will have two sharp Senior boys that have been taking programming from me off and on for three years.  During the same period I will have one scary smart Junior girl that took Programming I from the other programming teacher last year.  She is operational in Scratch and a bit in Small Basic, our two Programming I languages.  Our Programming I is a one semester taste of programming that is taken by sophomores.  It is an elective so class sizes will vary from 5 (last year) to 25 (year before).  As a result of the mixed class I need to dream up assignments that are interesting and that the boys have not done.  My goal is getting the kids to write a game for Droid using the Corona IDE.  I need to start somewhat easy to get the girl up to speed and used to my teaching style.  I can be a bit of a shock, I am not much of a hand holder, if they want to fail I am perfectly willing to let them.

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, 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”.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: