Beyond Blockly: Coding with Karel

CodeHS offers a wealth of resources to teach coding. As a middle school teacher I was on the lookout for a program that would have students code in JavaScript. My 6th grade students use Khan Academy lessons to code animals in hour of code, but I was looking for the next level for my 7th grade classes where students would learn the fundamentals of writing their own functions. Karel does just this.

CodeHS has a suite of lessons that could very well cover 4+ years of curriculum. They also have middle school lessons which work with Karel the dog and you can use it either as block code or have students write it out. I don’t want my students using blockly (my students are proficient typists, and I like how much they learn by writing and fixing the syntax of their code) so I find the introduction to computer Science track’s lessons with Karel the perfect beginning for my students. The first section goes over basics through Karel lessons, and these are a great method of teaching programming fundamentals.

The program introduces users to a dog named Karel who only knows 4 commands which are putBall(), takeBall(), move(), and turnLeft(). Students come to a stark realization quite quickly that Karel does not know how to turnRight, and they must call turnLeft 3 times in order for Karel to make this turn. They readily pick up functions, as functions allow students to write their own functions and to teach Karel how to turnRight.

karel code

My World in the SandBox

By writing functions, students learn they can write much more succinct code. This a simple concept but very valuable to learn. What’s great about the CodeHS lessons is that you can make your own programs using the Sandbox feature and have your students solve it.

The sandbox is just an area to practice and create code. I had my students solve some of my own coding challenges through the Sandbox. They already really enjoyed making their own projects to share this way as well.

I had students write the code for the puzzle displayed before teaching them functions, and then challenged them to write the code again using functions. Students were able to cut the number of coded lines in half by writing functions for their code.

Here’s the puzzle solved without functions:

Screen Shot 2017-04-19 at 4.37.53 PMStudents really enjoyed learning how to program their own functions. Out of 111 7th grade students, only one told me that coding isn’t for her. Many students in recent reflections told me that either they see this skill as very important to their futures or that they increased their interest in coding by doing these lessons. Here is a 7th grade students reflections of programming after completing 8/15 lessons of Introduction to Karel lessons:

“This year I have expanded my knowledge of coding. I had no idea about functions, and now I feel like I have mastered them. Who knew that you can put commands and an object will listen to them !! I improved so much with coding, because in 6th grade, I always strongly disliked coding. This year, since my knowledge grew, I am able to actually enjoy coding and get to spend time with it. Not only did my knowledge of coding grow, my vocabulary grew with it. We learned about functions, syntax, and algorithm, and before, I had no idea what any of those words mean, but now I have a better grip for vocabulary skills.” 

-Jasmine, 7th grade student



Categories: Coding


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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: