The grade three teachers this year asked me to do some coding lessons as we had wrapped up most of our curriculum needs with all of the doubling up that I do at the beginning of the year. I thought to myself “Sure, and this would be a great time to develop the Lego Coding lesson out more fully.” So here it is.
First, I started the students off by explaining that we were going to do a combined math, language and IT lesson. They all kind of looked at me like I was a bit crazy (but we all know this is true so they have learned to just roll with it!). I reminded them of the coding with legos lesson that they did in second grade. Then I told them that we were going to do a more complicated version of it. We weren’t going to use symbols or make up our own language, but we were going to use “real” coding terms.
I gave them each a base plate and six legos. They then had to decide on their starting positions. As you can see in this picture. Each group decided on their own arrangement for their starting position. The only rules were that no lego could be on top of another and they had to all be on the bottom half of the plate.
Then they began some of the math elements by copying their starting position into their math books. Their book have 1cm squares in them and I told them that 1 square = 1 dot on the base plate. They had to make sure that their drawing matched exactly the position of their starting position. This took the rest of the first lesson to get correct. There were lots of students at this point making connections to doing coordinate point work in previous math lessons.
The next lesson that we had I introduced the coding language terms that we would be using and asked them to record them in their books. I choose some simple terms to get them started. We had a discussion about which direction forward and backward were on the base plates and when lift and set would be used. Also how “turn” would have to be combined with “rt” or “lt” and have a number added. I had an image on the board showing what 0 – 45 – 90 degree turns of a rectangle looked like.
Then we started with the first line of our code. I explained to them that they needed to put a # then a sentence telling their “computer” what materials they would need to get started. We quickly realized that 4 dot Legos could come as squares or rectangles. So, we discussed how they could be described so that the “computer” collected the correct Legos at the beginning. They learned that lines that begin with # are things to read not do. They help the “computer” understand the instructions that are coming in some way.
Then they set about coding. They were only able to code a few lines before the time was up and what was really nice was the “ahhhhhs” that I got because they had to stop. They wanted to continue! It was great.
The this week they got on with more coding. And again they didn’t want to stop. They wanted to finish their first draft, which most of them did.
My plan is to have them “edit” their work like a piece of writing. The first edit will be for “Does it work?” which they will do with each other. As some of them have already found out, they aren’t’ always correct in their first draft.
Then I have taught the ones that have finished how to make repeat loops in their code. Then they went through their code to find places where they could use repeat loops and they rewrote those sections.
After the on paper edit, I am going to have them type up a Google Doc that has their code in a published format. I will have pictures of that part on my next post.