It’s Turtles All The Way Down

As a high school computer science teacher, I’m always trying to find ways to increase interest in this rich subject. Of course, there’s the obvious “the more students who take CS courses, the more my school will need my services to teach CS classes” aspect. But aside from that, I have long recognized that CS is a subject that a lot of students shy away from because they don’t know anything about it. I’ve got a growing list of students who, after taking their first programming class, discover a new passion. The unfortunate reality in my school is that the majority of students take just one class, and making matters worse is that it’s Microsoft Office. (Granted, it’s important that students be functional in Word, PowerPoint, and Excel, but this class hardly qualifies as “Computer Science”.) And since my state only requires one semester of CS to graduate high school, this is all the majority of students will ever see of the computer lab.

About two years ago, my fellow teacher and I began to realize that by carefully changing the Office class, we could do something about this. By selectively trimming away some of the less critical parts of the curriculum, we opened up 4 or 5 days in the semester’s schedule that we could use for enrichment, or as I call it, Explorations in Computer Science. Borrowing ideas from CS Unplugged, I used these days in the past few semesters to teach the fundamentals of binary (thus letting the kids figure out for themselves the “There are 10 kinds of people” poster in my lab), sorting algorithms (they sort themselves by their phone numbers without ever letting anyone see theirs!), and data encryption (sending messages using a simplified ASCII), and we ultimately get into a day or two of extremely basic programming in VB. The students find the material fascinating, and we’ve seen an uptick in enrollment in our programming classes.

This year we have a bit of a problem, however. Doing these lessons after the Christmas Holidays makes the most sense, as I don’t have to worry about anyone forgetting anything important that they learned two weeks of vacation earlier, and I can usually count on a week and a half to two weeks before the start of midterm exams. The nature of this year’s calendar means that there’s two and a half weeks between these milestones, which means … I need a couple three more “out of curriculum” lessons.

Think, think … what can I do, what can I add? The only rough spot I’ve noticed in the past year or so was when starting up VB. The students seemed to have a good footing with the “unplugged” concepts I showed them, they just had a mental hurdle when we got to “now let’s add some instructions to this VB Form we created.” And I’d rather NOT pack more VB lessons on the end, because I don’t want to have the students who DO decide to enroll in a VB class to essentially start over too much when they start that class. So I started thinking about the various “gentle introduction to programming” paradigms I’ve seen or heard of over the decades. Alice is an option, but it seems too big an infrastructure to tackle (from my perspective), and I don’t have a good feel for what can be done in 2-3 days. Kodu similarly looks like a lot to add to a computer system (in the lab or at home); but maybe I just don’t understand it well enough. I even thought about ChipWits (see several past blog entries), but neither my (now ancient) version nor the (forever under development) commercial version seemed finished enough; plus, like Alice, I’m not sure how those lessons could be applied in a real programming environment.

Suddenly the words “turtle graphics” popped into my mind. This was something introduced decades ago, intended to be the “gentle introduction to programming” for the world. The theory was you have a canvass (the computer screen), with a “robot” turtle in the middle. You give the turtle simple commands (“forward 100” pixels, “right 90” degrees, etc.), and the turtle moves on the screen. The permitted instructions make up what was called the LOGO language. The turtle has a pen attached to its tail, so lines are drawn as it moves. Without a great deal of effort, you can create some fairly complex drawings with very simple instructions. Obviously, it never went anywhere, but could I find use here, I wondered. A quick web search turned up a number of links to sites describing the various programs available (Wikipedia says nearly 200 implementations over the years), but I couldn’t find any self-standing versions (not that I looked that long). Geek that I am, my first thoughts were, “I wonder if I could write one?”

I must admit, I impressed myself. Starting from scratch, and a few websites to describe the LOGO language, I had a simple Turtle Graphics program with LOGO interpreter written in VB in about 2 hours. An hour later I had looping. Another half hour and I had file capability (to save and restore your creations).And about three hours later (2.5 spent “thinking”, half hour coding) procedures were working. There’s still more to add (variables, and the “turtle” icon itself come to mind), but it’s quite amazing how quickly this came together. (Click on the image to zoom in.)
Turtle Graphics
The pretty pattern of circles was generated from the eight lines of LOGO program on the left side. Aside from knowing that “forward 2” means draw a line two pixels long, and “right 1” means turn one degree to the right, the rest is entirely easy to understand even for non-programmers, which is the whole point!

Now, how will it be received in the classroom …


About Mr. I

After 17 years as a PC Software Engineer I gave it all up in 2000 to become a High School Computer Teacher
This entry was posted in Computers and Internet, Programming, Visual Studio. Bookmark the permalink.

5 Responses to It’s Turtles All The Way Down

  1. Kim Bruning says:

    Heh, did you realize that LOGO is actually a functional language, akin to LISP and Scheme? Some LOGO dialects even have their CAR’s and CDR’s right out in the open. I think the idea of the language is to start out with simple turtle graphics but end up someplace deep in lambda calculus and/or even growing direct to LISP (which is still a Serious Language, even today).

    The long and short of it is that if you get a “real LOGO” (for some definition of real, since there are so many dialects ) it’s actually a much more powerful teaching tool than you’d think at first.

  2. Mr. I says:

    Yes, I’m aware that LOGO is a functional language. My goal was to not so much to recreate LOGO, but to create a means of easily demonstrating how to make a computer do stuff. (I have a poster in my lab that says “Don’t do what the computer tells you to do, learn how to tell the computer what to do!”) I wouldn’t expect to get a whole CS course built on my little utility.

  3. Have you checked out netlogo? We’ve been using it for part of our intro course at Stuyveant for years.

  4. Garth says:

    Take a look at Small Basic. It is a free Microsoft language that will do turtle graphics. It is designed for beginners and has a large following. I teach Programming I with it. The kids enjoy drawing with it and it is extremely versatile as a teaching language.

  5. Great post! I think LOGO is a great learning tool for everybody from elementary school kids to college students. I’ve used it at every school I’ve taught at, and I’ve barely scratched the surface of what it can do. (My favorite version is NetLogo). Of course you can do intricate graphics with simple loops, but you can also create colonies of turtles to model biological and social behavior and convince more students about natural selection than their bio text could. It’s also a great stepping stone to learning a programming language like Python. I’d be very interested to hear how the students liked it.

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