← CS Unplugged

CS Unplugged activity

Pixel Pictures

CS Unplugged activity slides Lesson plan (and sub notes)

About 30 minutesSolo, or trade with a partnerPencil

Part 2 of 3 (Part 1: How It Works has the rule).

Decode these pictures

Each line of a picture’s code is one row, top to bottom. Shade the matching squares with your pencil: blank for white, solid for black. Work through them in order, easiest first.

Now encode one

Go the other way: here is a finished picture. Write the code for each row on the line next to it. Remember, every code starts with a count of white squares, so a row that starts with black begins with 0.

This trick has a name: run-length encoding, because it records how long each run of one color is. Fax machines send pictures exactly this way, one scan line at a time, and some image files (like TIFF and BMP) can be stored this way too.

Continue to Part 3: Make Your Own.

Now encode one (the house)

  1. 3, 2, 3
  2. 2, 4, 2
  3. 1, 6, 1
  4. 0, 8
  5. 1, 1, 4, 1, 1
  6. 1, 1, 1, 2, 1, 1, 1
  7. 1, 1, 1, 2, 1, 1, 1
  8. 1, 6, 1