
At PS 100 in Coney Island, there isnโt funding to update the computer labโs sluggish 2009 laptops. There certainly isnโt funding for complex programmable robots that kids can control.ย And yet, this week, 50 students at PS 100 had their first experience writing and debugging their own programs, and making a robotโโ albeit an unusual oneโโโexecute their code.
Enter Robot Ben
I came to Ms. Federโs classroom as part of Hour of Code, an initiative started by the nonprofit Code.org, which invites children and adults of all ages to spend one hour coding during Decemberโs Computer Science Education Week. For many, this is their very first taste of programming.ย The emphasis is on accessible, lightweight challenges, which can leave new coders with the sense that coding is for them.
As I introduced myself to each class, I explained that I had brought along a friendโ,ย โโRobot Ben,” โwhom they would meet shortly. (“Some people tell me that we look very much alike,” I admitted.)
The students formed groups of three, and I handed out instruction cards that they could use to command Robot Ben to move forward, turn, and pick up his power pack, which closely resembles my backpack. For the cards, I looted my copy of Dan Shapiroโs excellent board game Robot Turtles, repurposing the โexecute functionโ cards, which depict the robot turtle riding on a frogโs back, as โpick up itemโ cards.
Then it was time to bring in Robot Ben. I left the room, and Robot Ben walked in, arms and gait stiff. In a flat and mechanical voice reminiscent of Audrey 2 from the 80s TV show โSmall Wonder,โ Robot Ben introduced himself to the students.
Robot Ben explained that he needed their help to reach his backpack, located nearby on the floor. Each step forward would move him to the next linoleum tile; each turn to the left or right would cause him to face a different wall. He โresetโ himself to a starting tile and direction, and asked for their commands.
Taking things literally
The students began by choosing a single instruction card at a time. Inevitably, there were turns in the wrong direction: Robot Ben did what he was told, whether or not that was what the student intended. Just as Seymour Papert describes observing students debugging Logo, some students began to stand and turn their own bodies to the left and right to see what those commands would mean from Robot Benโs perspective.
The students succeededโโโwith a bit of guidance from Ms. Feder and two wonderful 5th grade helpersโโโin guiding Robot Ben to his power pack and commanding him to pick it up and put it on, command by command. Now that they understood the basic ideas, they moved on to assembling sets of two and three commands in a row, with Robot Ben starting a square or two away from the power pack but turned the wrong way.
One of the most celebrated moments came when Robot Ben was commanded to pick up the power pack, but when he wasnโt in the right location: dutifully, he performed all of the same motions as if the power pack was there. This offered a great way to discuss the way computers, and people performing any set of steps, need to run those steps exactly as they are written.
The Legacy of Logo
When I first started programming at age 7, I used Logo, aย wonderful programming environment from MIT. In Logo, you commanded a triangle called a โturtleโ to move forward, turn, and repeat, and all the while a line is drawn as the turtle travels.
If my programming exercise at PS 100 sounds similar, that’s becauseย Logoโs DNA is still very much with us. Code.org, MITโs Scratch, and Pencilcode, three of the most popular ways for children to begin programming, borrow many of Logoโs ideas and expand them in new, graphically attractive ways.
Central to Logo is the idea that the Turtle has its own internal sense of direction: you may command it to move forward, expecting it to travel up the screen, but if it is pointing to the left, it will go left.ย Logoโs co-creator Seymour Papert, in his 1980 book Mindstorms, emphasized that this sort of error was the whole point.
The algorithm may have something wrong with it, but the student doesnโt. Students will quickly learn how easily algorithms go astray. They learn to test and revise and test again. They learn that fixing mistakes in their method is a natural part of teaching the turtle (or Robot Ben) to do the right thing.
Revisions
The best part of this exercise was that,ย when a step would go wrong, the children didnโt shrug their shoulders with a sense of failure โ they jumped up with excitement and rushed to revise their algorithms to reflect what theyโd learned.
We finished the class by sharing thoughts about what had been surprising, and what students needed to do to get Robot Ben to respond the way they wanted. They wanted to be robots themselves, so the teachers took a turn giving commands, and students enthusiastically followed themโโโeven when it meant walking into a wall or taking an instruction absurdly literally. The final command was to march forward in a line out of the classroom, all programmers now.
ADVERTISEMENT