Teaching Practices

Happy CSEdWeek

In honor of CSEdWeek (Computer Science Education Week), I have a pledge to you all: I pledge to post a lesson plan or resource for every day of the week. I am a little behind, seeing as it’s already Tuesday, so I have some catching up to do.

Let’s start with Sunday, the first day of CSEdWeek. Since there’s no school on Sunday, I decided to turn my attention towards the usefulness of computational thinking around the home with my sock-sorting algorithm. Yes, you heard me right. Now, you can apply computational thinking to doing your laundry. But first, you might be wondering what I mean by computational thinking.

What is Computational Thinking?

Computational thinking builds on the power and limits of computing processes, whether they are executed by a human or by a machine. Computational methods and models give us the courage to solve problems and design systems that no one of us would be capable of tackling alone.

The beauty of computational thinking is that is helps us learn to use computers to solve problems or simply solve problems in any arena, such as dealing with the sock problem.

The Sock Problem

You’ve been there; I’ve been there too. Your laundry is piling high; your shirts are crushed under the weight of the three-plus loads you never bothered to fold; and now, your kids are looking for their underwear under their beds, in the laundry hamper, and anywhere but where they are supposed to be.

You head out to the laundry room, grab that pile of clothes and begin sorting. You start with the towels—they’re easy to find, easy to fold, and take up most of the bulk. Next, you find pants and shirts and go to work on them. Things are going well, in little to no time, your mountain of clothes is now more like the steppe of clothes.

You’re back is getting sore, but you plod on. You deal with t-shirts and underwear, and then, at the bottom, you see them: the socks. They lie in wait . They are the wiley clothes; in the many years you have folded laundry, you’ve never seemed to have completely folded them all. They are the smallest of the clothes, so even though they take up an eighth of the bulk of clothes, in number, they represent over half of the items in your laundry. If this weren’t bad enough, after dealing with the 30-some items of laundry, you’re still left with mis-matched socks and orphans. We’re they leftovers from a kid sleepover? Did one get lost at the last campout? Did they slip through your drier into another dimension…?

Few sober-minded laundry folders savor the thought of dealing with the socks. Socks are, after all, the dregs of laundry. Typically the last thing a person wants to do is go through this hodge podge of clothes: a sock jambalaya, as it were. Really, who in their right mind wants to go through the tedium of sifting through the 40+ socks to find their mates and return them to home base? What you need is a sock folding algorithm.

The Solution

The solution takes on two phases: divide and conquer and sort and match.

Divide and Conquer

Phase one has two steps that each follow the classic, Divide and Conquer algorithm. It’s where you divide your targets in half (or thirds or quarters). By doing this, you are able to focus on no more than half  of the possible outcomes at any given time. We’ll still have to deal with both halves in my sort, but this method helps you to not concern yourself with all the possiblities and focus on a manageable chunk.

With this in mind, the goal here is not to overthink.

  1. Begin with a general sort by color: this is no time to think, this is time to quickly toss your socks into one of two (or three) piles:
    • Whites
    • Darks
    • Multi-colored (this is optional, but often times necessary near the holidays)
    • Feel free to add a stack for greys &/or browns (also optional)
  2. Sort by Size: Take each of the three piles and apply one more general sort. Again, this is a quick divide and conquer sort without any thinking. The more you think, the longer and more cumbersome it becomes.
    • Short Socks here you want just socks that go no higher than above the ankles
    • Long Socks any sock longer than ankle length go in here

Apply a Sort to the Remaining Piles

At this point, you have 2-3 or so stacks of socks. It didn’t take long at all because you quickly divided them. Your job now is to sort each stack. There are all kinds of sorting methods, but there are two sorts worth mentioning: the bubble sort and the network sort. Some computer scientists will scoff at me for using the bubble sort, but remember, these are socks, not a table of database records.

The Bubble Sort: this is actually one of the most inefficient sorts as far as computer science goes, but in a short stack of maybe 10-20 socks, you probably won’t know the difference. Here’s how it goes. According to CSUnplugged.com

Bubble sort involves going through the list again and again, swapping any objects sideby-
side that are in the wrong order. The list is sorted when no swaps occur during a pass
through the list.

Technically, you aren’t actually sorting now. Instead you are matching socks with their mates, but the idea is the same, compare one sock to another, if it matches, fold them and pull them from the stack.

Network Sorting: in a network sort, you are applying multiple “threads” of sorting. You really need to watch the CS Unplugged Video on Sorting Networks or review the online lesson plan. Here’s how it works:

  1. Line all the socks from the remaining pile along the back of a couch
  2. Get your spouse and children (if you have them) to line up side by side starting on the left-hand side
  3. Each person takes a sock in front of them and compare to the person on your right.
    • If they match,
      • fold them.
    • If they don’t match,
      • check to see which of the two is smaller and put the smaller sock on the left and the larger on the right
  4. Continue this process until all are sorted or you’re left with sad lonely socks

What do we do with the left-overs?

I knew you were going to ask. This depends on your attitude. If you notice that a particular sock never seems to have a match or has a hole in it, it’s time to send it to the cleaning rag pile. If that solution does suit you—maybe you’re more the creative type—you could make a sock monkey or finger/hand puppet.

I’m sorry that my solution doesn’t sound much like computational thinking, but according to the Exploring Computer Science (ExploringCS) Curriculum…

analysis of various solutions and algorithms will highlight problems that are not easily solved by computer and for which there are no known solutions. (p. 21)

Maybe the leftovers are a traditionally unsolvable problem by computer standards. If so, maybe it can become a Turing Test.

Is Failure the Crazy Uncle?

Nerdgirls.com posted a great article from Katy Williams, titled, “If Necessity is the Mother of Invention, Is Failure the Crazy Uncle?”

Failure is just an intrinsic part of the innovation process…For, if you are hard at work on a problem, and are busy discovering all of the things that your work is not, you might finally stumble upon that which it is. Through your stumbling, you may come to understand the intricacy of your subject in a greater depth – or an entirely different light – that would not have been possible had the path been straight and unencumbered.

I wholeheartedly agree with the article. As Randy Pousch once said,

The person who failed often knows how to avoid future failures. The person who knows only success can be more oblivious to all the pitfalls.


Experience is what you get when you didn’t get what you wanted. And experience is often the most valuable thing you have to offer.

CS Unplugged in Eugene

Hello all teachers, administrators et. al. who have attended my CS Unplugged workshop in Eugene. I’m presenting a taste of CS Unplugged at the OACTE Spring Conference in Eugene, OR. I only have 1 hour and 15 minutes to attempt to cover 3 topics.

Below are the PDF versions of my presentations:

I hope I can get to the Searching Algorithms part because I have an idea for an epic human battleship contest. I spent much time preparing party hats and purchasing goodies for the winners. I might have to switch my initial order of events to make sure we can play battleship.

Introduction to Game Design in Scratch

There are many game-design related topics—too many to cover in a post or 1-hour workshop. I will nonetheless cover a handful of core topics:

  1. Game Setup & Preparation
    • Create core variables for main object: health, score, & lives
    • Position all sprites where they need to be
    • Hide any sprites that should not be showing
  2. Display Game Name & Brief Instructions
    • Display a stage Background with Game name & Instructions on how to play
    • Note: be sure to tell the user how to start the game
  3. Start the Game
    • I recommend you broadcast to start the game (as a message to all sprites)
    • Begin the GAME LOOP
  4. The Game Loop – This is where all the action happens. For the game loop, you need to deal with the following topics:
    • Character Control for the “hero”/main object
    • Artificial Intelligence for enemy/antagonistic objects
    • Collision Detection
    • The “End Game” this is where you determine how the game ends
  5. The End Game

I could write all about this, but I think it’s better to use visuals (especially considering how Scratch is virtually all graphics). For that reason see my PowerPoints:


Simple AI (Artificial Intelligence

How I script artificial intelligence (AI) for a flying "bogey"
How I script artificial intelligence (AI) for a flying "bogey"

Dealing with Navigating through Rooms

How I create multiple Rooms (apply to the stage)
How I create multiple Rooms (apply to the stage)
A Script for dealing with multiple rooms - Part one
A Script for dealing with multiple rooms – Part one

This is how I deal with moving through rooms - part 2

This is how I deal with moving through rooms – part 2

Scores and Lives


Why I use Scratch in my High School Computer Science Courses

“The best way to teach somebody something is to have them think they’re learning something else. – Randy Pausch

Scratch is an entirely graphics-based program that allows kids to easily manipulate graphics in order to create animations, video games, simulations, & other similar applications (whatever students may dream of).

The beauty is that while they are having fun making games and recreating scenes from their favorite movies or television shows, they are also learning computer science.


Why I Like Scratch?

  • It’s easy to use
  • You can easily edit and modify your resources: backgrounds, images, and sounds
  • You can import your own images and even animate yourself and friends
  • It’s like a puzzle where if the pieces fit, it will work
  • It covers most programming structures
    • input
    • output
    • math
    • repetition
    • conditional execution
    • assignment statement
  • Those programming structures allow students to visualize what the code looks like
  • They have an extensive online gallery that anyone can contribute to and share with others

How I Use Scratch in My Courses

This is more how I as a Computer Science teacher approach teaching with Scratch. I primarily use Scratch to introduce my programming students to program decomposition (how you break up a difficult programming challenge into smaller chunks) and game design. I have found that all I have to do is begin by showing the students the Scratch icon and encourage them to review the Getting Started with Scratch Guide. It’s sometimes only a matter of a few minutes before students are making complicated videos and games.

I also like to use Scratch for my special needs populations. Whenever I have a student on a modified diploma or one that needs additional help, I find that they can use Scratch as a resource and even as an alternative working environment for a program. So, for example, once my students begin writing programs in Python, which is all code, students with special ed needs could use Scratch to tackle the same problem.

The other way I use Scratch is in my exploratory course titled, Introduction to Digital Technologies. This course offers up a sampling of the various courses in our technology department. The goal of the course is to be a teaser for our other courses. Scratch is a quick way to get students interested in programming in a non-threatening way.

Teacher Appreciation Week

In light of teacher appreciation week, I would like to give a shout out to all my favorite teachers:

  • Mrs. Kuhlman, the best Kindergarten teacher ever. Okay sure, she was my only Kindergarten teacher, but the mere fact that I still remember her name, carpet time, and snack time (I can taste the graham crackers as I write this) shows how much of an influence she had on me
  • Ms. Hoff, my 3rd grade teacher who welcomed us to a new school (they converted our elementary school to a middle school)
  • Mr. Harris who always grew his beard out and recited the Gettysburg address
  • Mr. McChesney who made science so much fun with his Van de Graaff Generator
  • Mrs. Najarian who was as tough as nails but taught me English like no other
  • Mrs. Sears who introduced me to video production
  • Ms. McKinney-Wain, my English and Creative Writing teacher who humored my fictional oddities
  • Mr. Curtis, my Physics and Astronomy teacher, whose sneeze could blow your hat off. His physics tests were so rigorous, we were happy to get 60/100
  • Mr. Camwell, the funniest teacher I ever had. He gave us such tough tests that college was a breeze after his preparation
  • Mrs. Fangman my biology and anatomy and physiology teacher who loved her subject so much, we all loved it too
  • Professor Archer, my Core 150 professor who encouraged me to take his Jan. term class at Whitworth where I read a minimum of 100 pages a day (turning me into an English major)
  • Professor Oakland, whose primary assignment on the French study tour was to find a cafe for me to call my own and invite him to a cappuccino
  • Mr. Kilburg who accepted me into the MAT program at George Fox and made every “lecture” (they felt more like workshops) a fascinating sort of recursive experience where I wasn’t sure whether I should pay more attention to how he was teaching or pay more attention to what he was teaching
  • My uncle, Larry, a band teacher whom I never had but was always proud to have as an uncle
  • My mom, a former pre-school teacher who passed on the teaching legacy to me

SuperQuest Flash Files

Before I post all the files, I want to thank all who attended my workshop. We gathered quite the range of experience. I had so much fun, and I appreciated the input you gave. I hope you take more SuperQuest courses in the future.

Here you go folks!

Flash Files

These are the source files (.fla), shockwave movies (.swf), web pages (.html), & necessary JavaScript (.js) to both edit and post animations. They are all zipped, so you will need to save them (right-click > Save Target As…) and then extract the zipped files.


Photoshop Assignments

Due to popular workshop demand, I have added a copy of the Photoshop assignments that I gave my students last semester. I’ve linked to a pdf version of my Photoshop assignments here.

Note the following ideas:

  • A great way to start a web design class is to start with Photoshop – that way you wait to introduce the core knowledge of HTML until after the drop-date, and you minimize having 1 or 2 students arriving for the first time when the rest of the class has moved on to images and tables
  • The sooner you get your students learning independently, the better – my favorite moments in my web design class happen that by the time I get around to answering a student’s question, they tell me, “never mind; I figured it out.” – I could give my students a web page, or I could teach them how to code.
  • Encourage students to teach themselves (and each other) – this is pretty much the same as the previous note. I regularly assign tutorials to my students. You’ll note that I have one assignment where everyone does the same tutorial, and the rest of the tutorials, I encourage students to find one on their own (one that interests them). Note the following:
    • Make them follow the tutorial, but make them change the shape, color, text – to prove that they followed the tutorial and didn’t just copy an image of the final result
    • You might want them to write a review of the tutorial – not all tutorials are well-written, and not all tutorials are complete