Tuesday, March 3, 2015

Teaching Coding without a Computer

It was our second lesson on coding without a computer.  If you would like to see our first lesson check it out here.
Today, I had the learning carpet (a square carpet with a grid on it) out in the middle of the classroom.  I told the students that we were going to write a simple algorithm using the following language to move a stuffed whale to a predetermined spot on the carpet using the following commands:
·      FW – forward
·      BW – backward
·      LT90 – left turn 90 degrees
·      RT – right turn 90 degrees
We were then going to test the algorithm to see if the program ran the way we intended it too and if it didn’t, we would debug the algorithm.

We started very easy with only having to write a few lines of code to get the whale where we wanted it to go.  I then added little math counters as obstacles so it wouldn’t be a straight shot from point A to point B.  After doing this activity several times together, it was time for them to try it on their own.  We placed the whale on the carpet and then I placed a pink sticky note to where I wanted the whale to end up.  I also added the math manipulatives as roadblocks that the whale would have to maneuver around. 

 Like most programmers, my students’ first attempts were not completely successful.  This is when I introduced the word “debugging”.  The kids loved coming up to the carpet with their lines of code and trying out what they had written.  Out of 15 tries, we did not have a single student get it completely correct the first try.  It was music to my ears when each child tried their code and realized that it was incorrect and replied with, “I need to go debug my code and try again.”  This activity was challenging enough that my students had to debug their program, but not too challenging that they couldn’t debug it themselves.

My students learned key skills today in writing and debugging code without a computer or device.  Students worked on problem solving, independent work and resilience.  My students also felt a sense of accomplishment and satisfaction when they figured out how to get the whale to the pink sticky note.  When the period came to an end, there was a lot of moaning and asking, “When are we going to play this again?”  Little did they know that they were learning key skills in problem solving, directional language and being able to describe movement from one location to another using a grid map, which are all math curriculum expectations.

1 comment:

  1. I really love your approach to teaching kids algorithms and getting them to stick with their plans long enough to see their first implementations before changing them. I think the skill of understanding WHY something didn't work is the most important part of this process. I wonder how we might get kids to "debug" more of their work.

    I see this as being highly applicable to other areas of their learning lives. They should be able to "debug" their writing assignments and understand the reasons why their arguments (or sentences) aren't working the way they want them to. They should be able to "debug" their math problems and see why the numbers don't add up. These are skills that we can count on for pretty much anything that requires you to understand a mistake and problem solve a solution. How can we encourage this kind of meta-cognition (which is really what it is) in other ways?

    P.S. This comment is a part of the #C4C15 project. Find out more here: http://learningischange.com/blog/2014/12/27/c4c15/