Archive | Lessons RSS for this section

Achievement Mapping in OneNote

So I’ve been thinking a lot about competency-based education – the idea that learners should be able to progress through a flexible map of skills or concepts or dispositions, tracking progress and reflecting as they go, with as much choice as is reasonable on the timing and nature of the learning, on a time scale that’s right for them. Simple… right? I’m playing with some ways of piloting the idea in my classroom and I keep thinking about gaming in this process. Most video games have levels or achievements, and gamifying education is based on the inherent motivation built into video games. Every time you fail a level, you get to try again. You try until you succeed. Success metrics are clear, and when you succeed you go on to the next level. I like playing Minecraft with my kids, and we have fun finding our way through the Minecraft achievement map. The skills are really clear-cut and the achievements have to be done in order.

Anyone who plays Minecraft recognizes this map.

Anyone who plays Minecraft recognizes this map.

I wonder if I can apply the gamification principles to a class I teach. I’m experimenting with OneNote Class Notebook to push an achievement map out to my students. I need the map to be flexible – I don’t have it all written right now, and I’m not sure a competency map should be articulated completely from beginning to end. Do you want your child’s educational path pre-mapped from K through 12 or do you want them to be able to take unexpected turns as needed? I’d like to be able to push achievement challenges to the students as they come up, and maybe assign achievements flexibly depending on student choice and need.

I can push the achievements out as documents that contain a checklist, maybe a place to paste some code, and a reflection from the student. I can respond to their achievements and use this as the basis for conferencing with them about their learning.

For example, as my first two achievements for kids:



This semester, I wouldn’t use the achievement map as a grade, but I could leave the door open for it as an assessment tool in the future. How far would a student need to progress through the map to “pass” the class and move on to the next one? This is something I hope to answer after this semester.

I really wish I could create a clickable map like the Minecraft one, where you could hover over a box and it would tell you about the achievement, or click on the box to submit an entry to pass the achievement. When you passed one, the following achievements would be enabled. I know this is doable, but time and 217 students and so many preps and…. it’ll have to wait for a break, unless someone has created a tool like this and I just don’t know about it. Any badging or achievement-mapping tools out there that I should learn about?

What do you think? Have you ever gamified a graded class? What structures did you use and what should I fix before diving into this?

Etching your own PCB’s in a classroom

A couple of years ago, one of my former students came to visit. He brought business cards and a selection of little printed circuit-boards, or PCB’s. My questioning turned into a lesson in which a 15-year-old kid taught me how to install some circuit-designing software, create my own circuit board, export the design and e-mail it to a factory in China where the boards would be manufactured and mailed to me. It was one of the most empowering things I’ve ever learned! I feel I got some valuable consulting work from this student, and he provided it for free. What a generous gift and a valuable example of a teacher and student learning together.

A former student taught me how to make this!

A former student taught me how to make this!

I found out since that time that you can actually etch your own printed circuit boards at home, for quick prototyping. In electronics class, my co-worker Tracey and I created an engineering project for the students: design or modify a small, rechargeable LED-based lantern that works. This semester, I thought I would offer the opportunity for students to learn to etch their own PCB’s if they wanted to do it for their design. This was a rich and challenging project, and I want to share how we did this with middle school kids – with some notes of caution. It’s hard to do in a big group. I was grateful to have Tracey’s presence to work with most of the class on an alternate lesson while I took small groups to work on PCB design and etching. It was failure-prone and high-frustration, but also high-reward. Here’s how we did it.

First, the students need to design their circuit and generate a high quality, printable image of the copper traces. I used Fritzing, a free program that is fairly easy to use. I taught the students how to lay out a simple parallel circuit with resistors and LED’s. The components can be either surface mount (SMD) or through-hole (THT), but you want to choose Through-hole. Pay attention to the pin spacing to make sure it matches the components you have. In our case, we needed 3 mm spacing for the LED’s and 400 mils (these are thousandths of an inch, not the same as mm) for the resistors. I don’t know why the default units were different. I added a couple of via’s to connect to the switch and battery. Choose the “home-etched” setting for via’s to make them a little bigger.

Completed simple PCB in Fritzing.

Completed simple PCB in Fritzing. Most students added 5 or 6 resistor/LED pairs.

Students could add as many resistor/LED pairs as they wanted, and rearrange them as needed. Some students created some interesting layouts for their PCB.

Next, we had to export the file to a high quality PDF. In Fritzing, choose File –> Export –> As Image –> PDF.

I stitched together a couple of methods from online articles for the etching part. This article from Hackaday used the magazine page transfer method, and it worked all right with some cautions.

Here are the supplies you need for this step..

  • Glossy magazine paper and a laser printer. We found the alumni magazine from my university works well! Its 8 1/2 by 11 size and nice sturdy paper loaded and printed in the laser printer perfectly. We had some success with catalogs pulled from my mailbox too, although the paper was thinner so it tended to jam.
  • One-sided copper clad PCB. You can get lots of this very cheap on eBay.
  • An iron and ironing board (we borrowed these from the family consumer science teacher)
  • A scotch-brite scrubbing pad.

You need to load the glossy paper into your laser printer and print the PDF of the copper traces. Fritzing will export a lot of files into a folder – print the one that ends in “copper_top_mirror”. You might have to try a few times before you get a nice printout on the magazine paper.

Buff the copper-clad PCB with the scotch-brite pad, until it’s roughed up a little.

Turn the iron to its hottest setting, and make sure there’s no water in the iron. Put the magazine paper with the image on it face-down onto the copper clad. Push down HARD with the iron for a full two minutes. Then move the iron around still pressing down hard, for 4 more minutes. This process sometimes took 4 tries to get a good transfer and was really difficult with a number of groups to work with. Imagine it takes pressure on every wire trace in order to transfer it from the paper to the board, and visualize how you have to press the iron down to make this happen.

Ironing. For the first time ever.

Ironing. For the first time ever.

Inspect the copper clad to make sure the image transferred with no thin or broken spots. We attempted to fix a couple of the designs with Sharpie, but it really didn’t work well. Better to transfer properly the first time.

A bad transfer, and a better one.

A bad transfer, and a better one.

Now you’re ready for the etching. For this part, I used the second half of the instructions from Blondihack. Some blogs recommend using muriatic acid, but with middle-schoolers the normal kitchen chemicals are the way to go here. You will not regret using plain old vinegar. You really should use a proper science lab with fume hoods, sinks and safety equipment. At the very least, make sure you have safety goggles and nitrile gloves for everyone, and access to a sink. To do the etching, you need:

  • White vinegar
  • Household hydrogen peroxide
  • Some salt
  • Foam brushes
  • Plastic tubs
  • Measuring cups and spoons
  • Safety goggles and gloves
  • A timer
  • Acetone (nail polish remover)

It’s pretty simple. Pour equal portions of hydrogen peroxide and vinegar into a shallow plastic tub. Add about a teaspoon of salt and stir it gently. When the salt is dissolved, put the PCB into the solution. You’ll see a film of yellowish gunk appear on the board, and over time the liquid will turn blue. About once a minute, use the foam brush to wipe the gunk off. It took us about 50 minutes to complete the etching. When you’re close to done, the edges of your board will be free of copper. You’ll know you’re done when all of the copper is dissolved except for what’s under the black toner. When you’re at this point, rinse the board with lots of water. We washed the remaining etching solution down the drain with lots and lots of fresh water.

This is boring work, but the kids don't mind socializing while they wipe the boards down once a minute.

This is boring work, but the kids don’t mind socializing while they wipe the boards down once a minute.

When you're close to done, you can see the edges of the board are free of copper.

When you’re close to done, you can see the edges of the board are free of copper.

Done, rinsed and ready for the next step.

Done, rinsed and ready for the next step.

When the board was rinsed, we took paper towels and some nail polish remover (acetone) and scrubbed the rest of the toner off the board until the copper was visible.

After scrubbing with acetone. Ready for drilling!

After scrubbing with acetone. Ready for drilling!

I used Blondihack’s method for drilling holes with a Dremel tool. I did the drilling and chose not to let students use the Dremel. It has the potential to really hurt you and this step requires a steady hand. Get your inner brain surgeon ready.

For the drilling, you’ll need:

I recommend clamping your PCB to the table on top of scrap wood. You really want to make sure it doesn’t move around. Wear the safety goggles. Use the 1/32 inch drill bit and carefully drill a hole in each location on the PCB.

Next the students can solder the components onto the PCB. You can only solder them onto the copper trace, not onto the blank side of the board. Clip on the battery and test it out! Students sometimes had to use solder or jumper wires to fix locations where the copper traces were broken or thin. They cut the boards down to size with tin snips (fairly cheap at Home Depot) and sanded them when needed.

Soldered and cut! They look great.

Soldered and cut! They look great.

The groups that had fewer problems were able to finish their circuit boards in 3 class periods, but some student groups took up to 6 class periods. These groups had to re-do steps along the way, usually in the printing and transferring, but sometimes in the soldering as well.

It was a supremely rewarding process. The students were so proud of their work. We all learned a lot about how printed circuit boards are made, and I think the kids felt as empowered as I did when I made my first PCB with that student so long ago. Students stayed after class and after school, trying over and over to get the process right. They really wanted to finish it once they started.

Showing off their work with pride!

Showing off their work with pride!

I would strongly recommend having extra adult supervision if you try this activity with kids. Six students at a time seemed to be my capacity – consider bringing in parent volunteers or community members and training them on what to do. Plan ahead for science lab space, drilling and soldering, and for how you’re going to manage failures, because they will happen. It’s part of engineering.

If you try PCB etching with your engineering students, I’d love to hear from you. What went well? What would you do differently? What did I miss that I could be doing better?

Thanks a bunch to Quinn Dunki and Jason Rollette for their tutorials.

Reflecting on Reflecting

In my 6th grade tech class, called Web 2.0, my colleagues convinced me to include some keyboarding practice in the curriculum. It’s not a fun topic to teach, but it is a really important life skill and it’s not taught in any of the kids’ other core classes. One of my fellow tech teachers had a great idea to have students keep a spreadsheet of their keyboarding speeds throughout the quarter. The students take a 1-minute test every day and log their score in the spreadsheet. We use the sheet to teach students about using formulas, and it’s a good daily reflection tool on their growth.

We use NitroType and as tools for practice. NitroType is really engaging and I really like the drills on

I have the students calculate their average speed (the average formula), their growth (using max, min, and subtraction), and how many times they got 25 words per minute or more (using the “countif” formula). A finished spreadsheet looks like this.


Here’s what I find fascinating. I think teaching keyboarding is really boring. The online tools make it bearable. I put on my game face and practice with the students, and challenge them to race me to keep myself engaged in it. The students, however, LOVE it, and I think what they like about it is that they track their progress with a number. They know when they’ve improved. The goal is crystal clear and they can tell instantly if they’ve met it.

At the end of the quarter, I asked the students to reflect on whether they met either the goal I set for them (which was to gain 10WPM and be over 25WPM at least once), and whether they felt they had met their personal goal. These were some of their comments.

“I Met my score :)”

“I love TYPING”

“My goal was to increase by 10 words per minute. I started at 27 words per minute and slowly increased and got better until I got to 39 words per minute which was past my goal”

“My goal was to get to 35 WPM and I passed it by 10, I am really happy.”

“My goal was to get more accurate and more comfortable without looking at the keys. This I think I did improve on.”

“I improved so much!!!!!!!!”

“I think I’ve really improved with my keyboarding. I think I met my goal because I beat 25 by at least 20 and all of my scores were in the green. I will continue to practice keyboarding as I believe it will help me in the future. The time we had in class helped my improve and I fell like I’m 10 times faster than I was last year. Even if that is an exaggeration I really mean it when I say I got a lot better, so thank you for making me not only a better typer, but a better student as well.”

“I got to 25! That was very exiting because I am not that fast at typing! and I made my spread sheet very colorful!”

“I am proud of where I am with my typing and gained ten WPM”


Isn’t it interesting how motivating it is to have a clear goal and know immediately if you’ve met it or are improving? I see this every quarter. I wish I had a way to give students this instant satisfaction in classes in which progress is slower and proceeds over the course of a project. Learning coding can feel like this if you do activities like an Hour of Code, but what about learning in a creative problem-solving setting, where you have to investigate, discover, create, try and fail, iterate, gather data and perfect an actual product? Can I help students reflect on their day-to-day growth and their short-term goal setting as a motivational tool? I’m sure I can facilitate this by putting some good reflection tools in place. Let’s make this a New Year’s Resolution – I will help my students become motivated and reflective learners, and to track their own progress to make them feel the same sense of satisfaction my keyboarding students get.

A Week of Minecraft Camp

I have not blogged in a very long time! A lot has happened in this exciting semester, including being honored as an Allen Distinguished Educator and getting to work with a phenomenal team to create resources to share with the public. I will write about that experience as well, but am moving in reverse-chronological order, starting with the most recent project. I teach classes at our district STEM institute every summer (find the website here: . I love teaching at the institute. I wish school could feel like this all year long. This year, I had the pleasure of teaching a Minecraft Explorations class during the morning and afternoon. It hit me about a week before the institute that I was getting paid to play Minecraft all day long – living the dream!!

At the beginning of this school year, I purchased licenses for MinecraftEDU and I love it. Unfortunately, as you can tell if you follow the link above, the old MinecraftEDU is now in transition. Microsoft is re-writing and re-releasing the educational version as Minecraft: Education Edition. I would love to use it, but it’s only going to be available on Windows 10 and my district’s IT department has been very clear that we are not moving to Windows 10 this year. I had JUST convinced a whole bunch of colleagues to purchase MinecraftEDU, and a couple of them had JUST gotten the funding approved, when we found out we could no longer purchase MinecraftEDU – and the new Minecraft: Education Edition is not an option for  us at all because of our operating systems. It is extremely frustrating – I believe in this tool and think our kids will really benefit from using it in classrooms, and our progress as a district has been completely shut down.

I am still able to use the old MinecraftEDU, and I did. The kids loved it and I had a wonderful week. I decided early that the kids could make a creative map and design anything they wanted, on a safe school server – and that I would provide mini-lessons every day to add a little more to their Minecraft toolkits so they could build even better things at home. I provided them with flash drives that had all of the mods, maps and documents they would need.

Day 1: Beginning build and Redstone lesson.

After some getting-to-know you activities, I told students they could sit next to one or two people they would like to build with. We first installed mods on the computers: I installed Mr. Crayfish’s furniture mod, BiblioCraft, Custom NPC’s, ComputerCraftEDU, Malisis Doors, Carpenter’s Blocks, and the Key and Code Lock mod. I opened a creative server and had everyone spread out with groups far away from each other. I told them they could build a home and to pick a theme – a castle, a dungeon, a zoo, a specific animal, a treehouse – anything they wanted. The kids loved the mods and were thrilled with the furniture mod, which allowed them to have Minecraft blenders, refrigerators and sinks among other things. The Carpenter’s Blocks are really cool – they allow you to create angled, curved and sloping blocks with any texture you want.  And the Malisis Doors mod allows you to create interesting doors and even custom doors with special animations, textures and combination locks. Fun!

We then saved and temporarily shut down the creative world, and I opened a redstone world map that I made. It’s located here:

This map takes students on a tour of redstone contraptions. I spent some time over the weekend watching video tutorials on more advanced uses of redstone. Did you know you can make logic gates with redstone? You can create a NOT gate, OR gate and of course an AND gate. I wouldn’t be surprised if someone, somewhere, has made a fully-working computer or arithmetic-logic unit using redstone.

In the map, students explore different redstone devices and activators, and also learn about logic gates, repeaters and comparators. I finished the map with a Kahoot! quiz and then opened the creative world again. Students were instructed to add their own redstone contraption to their home. Some of them were very complicated – I would never figure out how they worked!

Day 2: Custom NPC’s

Non-playable characters let you turn a map into an adventure or a quest. These characters can be configured to follow you, fight for you, trade with you and have dialogs. I gave a mini-lesson on how to create an NPC using a special wand, and then how to set up a dialog with multiple-choice answers. We also learned how to add quests to the NPC’s dialog. The non-playable character can be part of a storyline, leading you from adventure to adventure. I suggested that the next time students have a science project, a book report, or a time in history to write about, they could do the project as a Minecraft adventure! Wouldn’t that be a more fun way to learn about the Revolutionary War if you could interact with the main players and let them tell you about the events?

The lessons are summarized in these videos.

NPC dialogs and command blocks:

This video shows how to use quests:

To finish out the day, I gave the students command blocks using the command: /give @a command_block

I gave kids a very basic tutorial on using command blocks. You can set up the blocks with a command, and activate it with a lever, button, or other redstone connection. Some simple commands include:

Summon an entity: other entity names can be found online

/summon Zombie

Give the nearest player an item

/give @p cookie

Teleport the nearest player to the following x,y,z coordinates.

/tp @p 100 75 -200

I would not recommend giving command blocks to a large class and you really need to be cautious with them. They give great power! There is a connection with computer science here… each command is like a function, and the parameters follow the function name. Just as with any computer language, punctuation, spelling and capitalization are important.

We played a Kahoot quiz on custom NPC’s to finish out the day.

Custom NPC Kahoot

Day 3: ComputerCraftEDU

On this day, we introduced turtles! These are adorable Minecraft robots that you can program to mine, dig, chop, attack and build for you. The ComputerCraftEDU turtles use a graphical programming language that is fairly intuitive to learn, and maybe more importantly, super cute. I introduce the turtle coding with a little “hour of code” activity I developed for them.

Turtle Hour of Code

The language looks like this. This program tells a turtle to dig, move forward, dig – then place a block, move backward, place another block.


The language has variables, loops and conditionals as well. We talked about how important it is to specify WHICH steps you want to repeat over and over again. I often introduce loops by having students write instructions for a “human” robot to do something such as walk down a line of kids and tap every kid on the head. The instructions might say something like this:

Start at the first kid
Tap on head
Go to the next kid
Repeat until no more kids

If I follow instructions like that, I may tap only the first kid on the head and then just walk to every other kid until I get to the end of the line. Or, I might repeat all of the instructions – start at the first kid. Tap on head. Go to the next kid. Start at the first kid. Tap on head. Go to the next kid. Our language needs a way to specify a beginning and end of what exactly is repeated.

The Turtle coding language has this. For a repeat loop, for example, the instructions to be repeated are bookended by “Do” and “End”.


The “Place” and “Move Backward” instructions are inside the Do and End blocks, so the turtle will place a block and then move backwards, and repeat those 2 instructions 8 times.

After we do some whole-class activities experimenting with the Turtles, the whole class discusses how you would write a useful program that the turtle could run that would help you in Minecraft. We talk about some activities you do in Minecraft that might be helpful to have a robot do for you: exploring at night, fighting some of those nighttime mobs, mining, chopping down trees, building a house, farming. We choose one of those examples – say “mining” and discuss what exactly you’re doing, step by step, when you mine. The kids usually start by describing how they dig a staircase into the ground. But we have to talk about special conditionals that pop up. What if you dig into gravel? What if you dig and find lava, or a cave? If you find iron,  should you keep digging forward or do you dig in all directions to see if you’ve hit an iron vein? Once you’ve dug down a certain depth, how do you return back to the surface? Writing all of this down as a program becomes a challenging and interesting task.

I gave the kids a couple of example programs that do some complicated mining and tree-felling, and let the kids explore the pros and cons of them and try to make the programs better.

Mining and Tree-Felling Programs


Of course,there is a ComputerCraftEDU Kahoot Quiz to finish things out. 🙂

ComputerCraftEDU Kahoot!


Day 4: Modding

Kids were very interested in modding, but this is the most difficult concept to teach. What is a mod? Think of Minecraft as a box of plain legos. The analogy to a Minecraft mod is a specialized set of Legos… the Harry Potter kit, the pirate kit, the farm kit. A mod uses Java code to connect to Minecraft’s events and data structures, letting you create customized blocks and items and even mobs. Most kids have an idea for a mod they’d like to create. Most kids will not get there on their first mod, but they’re excited to start down that road.

I have an O’Reilly book about modding that uses Forge and Eclipse, and I was fairly successful at home at writing a simple mod and getting it to build. I ran into troubles when I tried using this on the school computers – installing the software, keeping the folders straight, and working around blocked websites was very painful. Then one of my students introduced me to MCreator. This is a very nice tool found here:

MCreator uses forms and menus to generate the Java code for mods. First we used the “Tools” menu to access the texture drawing tools, and kids drew their own texture for a block or item. Next we went to the Workspace and created a new block. The menus let you choose the block’s texture, its properties such as hardness and luminescence, and the events it responds to – what happens when you place it, right-click it, destroy it. The tool creates the code, and then you can click “Export” to create a .jar file, drop it in your mods folder and voila! The only catch to running this on a school computer was that the kids have some websites blocked (including that make it so they can’t actually build the mods from school. I had the students give me their MCreator folders on a flash drive, and I built the mods and gave the flash drives back with the .jar file on it. They had a lot of fun seeing their mods come to life in a singleplayer world.

Day 5: Putting it all together

On this day,  we made our houses presentation-ready and put together a poster board for the parents. We played some charades and made sure the map, mods and MCreator files were all on the students’ flash drives. For files created in MinecraftEDU, they could use the maps and mods at home if they used the right version of Forge. The version I found that worked is I gave kids instructions for copying the mods and the map for use at home:

Home instructions for Minecraft

We played survival, just for fun, for the last hour of class. Great fun and excitement to hunt, gather, and dodge zombies together for a while.

I feel when you’re teaching just a weeklong class, you have a tradeoff to make. I chose to focus on new tools and skills in the Minecraft world rather than creating a big project – we worked on a creative house build but the class was really composed of four mini-lessons and not one large product. I also think there’s a lot of value in having the students plan, execute and troubleshoot through a whole-class build with a theme. With the custom NPC’s, I’d love sometime to create a multi-player adventure map with quests and an educational purpose. Maybe that will be my focus of my Minecraft enrichment class next year!


Arrays in Middle School #csk8

How do you give instructions to pull a random book off a shelf? Or to sort all of your books in alphabetical order? Or to remove the books off your shelf that were written before 1960 and order the rest by date? Or figure out the average length or Lexile level of all the books you have on the shelf?
If you have ever considered problems like these, a computer program can help you and you need to use data structures.

In Computer Science, since I started the semester right away with coding AND I have a very sharp class this semester, we have actually gotten to data structures – the kids are learning about arrays. I mostly learned about arrays in college, so teaching it to middle schoolers is still something I’m new at. I am spreading the instruction out over about a week and a half.

I started by addressing the need for arrays, by having the kids modify a little fortune-teller. The starter code is here.

Fortune Teller Starter

The fortune teller uses three variables to store different fortunes, and then picks a random number. Then it uses a series of if/else statements to choose which fortune is displayed. Pretty simple. I asked the kids to add a new fortune to it and tell me in how many places they had to change the code. The kids did, and the consensus was that it needed three changes: add a new variable, modify the random number generator, and add one more else/if clause.

So then I led them through a short explanations of arrays. You have one variable and it contains an indexed list of data instead of just one data item. The first item is always item 0, then item 1 and so on. This indexed list is called an array. It’s like the arrays they worked with in math class to multiply. You can make arrays that are two-dimensional or more, but this one is just one-dimensional for the list of fortunes.

We modify the program so it looks like this.

Array Fortune Teller

I asked the kids if they would prefer me to go over the instructions live or let them watch a video. Almost the whole class preferred live instruction, which surprised me. I made this nice instructional video but then didn’t use it.

Instructional video: Using an array in the fortune teller

With the new code, adding a new item to the list of fortunes requires only one change to one line of code. Much simpler to make changes! But a little trickier to code.

In the next lesson, we look at how to use a loop with an array to do something simple, like print the contents of an array to the screen. This is also a mainly teacher-led demo, but I did make a nice instructional video that again I didn’t use.

I start with this code:

Print an Array Starter

And then I had this video, which we didn’t use:

Video for looping to print an array

I feel that when you start getting into data structures, that’s where interesting algorithmic work with computers really starts. I decided to have the kids do a little algorithmic role-play to see how they would make a computer work with an array.

I lined up a row of kids at the front of the board and told them to all write down a number on a card, but keep the number hidden.

An array of data, starting from index 0. Can you write instructions for a robot to find the largest number?

An array of data, starting from index 0. Can you write instructions for a robot to find the largest number?

Then I asked the rest of the class to write a set of instructions that a robot could use to figure out the biggest number on a student’s card.  The kids asked “can’t you just write an instruction to have everyone flip their number over and see which one is the biggest?” I said no, robots really need things written step by step, so start with which kid I should walk to first, and what I should ask them and so on.

I knew I’d have some kids that would absolutely fly with it, and I also knew I’d have some that would have trouble with this concept. I did. However in the discussion, a basic understanding of the algorithm came out:

  1. Look at the first number.

2. Remember it.

3. Look at the next number.

4. Compare this number to the one you remember. If it’s bigger, then throw away the number you are currently remembering and remember this one instead.

5. Repeat steps 3 and 4 until you run out of numbers. The number you’re remembering is the biggest.

Arrays are hard, in which the array itself has a variable name, and then the index in the array can be referenced by another variable.

int p = 2;

This use of a variable is pretty straightforward and only takes a little practice to understand. Kids have been using variables since 5th grade in math class, so they have some background with it.

int [] p = {9, 72, 40, 12, 35, 99, 33};

This is more difficult as the whole array is named “p” and your algorithms require that you reference each number with “p” and its index. But so powerful. You can manage really complicated math once you have a basic understanding of data structures.

Anyway. We coded the “find the biggest number” problem by using a sample program, below.


int [] nums = {12, 59, 2, 63, 400, 88};
void setup() 
  int num_i_remember; 
  num_i_remember = nums[0];
  for(int i = 0; i < nums.length; i++) 
    if(nums[i] > num_i_remember) 
      num_i_remember = nums[i]; 
  println("the largest value is " + num_i_remember); 


The challenge I gave to the kids was to write a teacher tool. Sometimes, teachers have to do creative things with their data. For example, I gave 11 quizzes during a semester. Students convinced me to drop the lowest score and average the other 10.

The pair programming task: given an array of 11 quiz scores, find the lowest score, drop it and average the other 10, then tell me the average.

The kids did a really awesome job and only a couple of pairs got stuck and needed a lot of support. The most common solution was the one like Anoushka’s, below. She modified the code that found the largest number so it found the smallest instead. Then she averaged the rest of the numbers using brute force, but with only 10 numbers it worked just fine.

Anoushka’s Teacher Tool

Some students were able to get how to iterate through the array to find the total, subtract the lowest score, and divide by how many numbers there were. Maya’s solution works no matter how many quizzes I give during the semester.

Maya’s Teacher Tool


What’s next? I think we will do some unplugged activities to refresh / review, and then make a project that brings arrays to life by storing information useful to teenagers – like the locations of sprites in a video game! I think we’ll work on an animation with a bunch of images that have x and y coordinates stored in an array. Maybe we’ll think of different structures for the data (one array storing both x and y coordinates? 2 arrays? Dare I introduce multi-dimensional arrays?). Then after that… a mini-project, a little game or interactive animation including all of the things we’ve done so far. Processing is so colorful and interesting, I want to see what the kids can make with it.




Review/Extension Activities for Looping and Conditionals

More than once I’ve finished or half-finished a lesson knowing that some kids understood most of it, some really didn’t get it at all and I didn’t get enough information during class to really understand where I should go with things the next day. If you back up and review, you bore the kids who understood already and run the risk of teaching the same ineffective way you did the previous day. If you plow ahead, you will really lose the students who were barely understanding the day before.

In this situation, I sometimes do a code-analysis card sort.  I write a handful of code snippets and produce output from them. Mix up the code and outputs, partner up the students and ask them to match code to output. It takes less than 10 minutes, and then you have a whole-class discussion where you ask groups to report out. What’s a match you feel confident about and why?  What is a match that gave you trouble and why?

Here are a couple of my card-sorts from this year’s CS Exploration course, in which I have been teaching Processing.

Function Match:

example card from the function card sort.

example card from the function card sort.

In this card sort, there are four function definitions, four function calls, and four descriptions.  The students’ job is to match a definition to a call to a description. Before making copies, I put a letter (A,B,C,or D) on each function defintion, a number (1234) on each call, and a symbol on each description.

The card sort is really simple because each function has a different number of parameters. If a student can recognize that the definition with three parameters matches the call with three parameters, they can do the sort. But it creates good discussion when you talk about why the matches work, what the parameters mean, and how we know the descriptions match the definition and call.

I also created a Function Kahoot! quiz to do before or after.


Next I have a card sort on looping. It only focuses on While loops. The task is to match the code with the output.


The cards are here:

Again before I make copies, I label the code with letters and the outputs with numbers to make it easy to report out what matches the students made.

The discussion on this sort usually hits on two ideas. Is the x-coordinate or y-coordinate changing, and how do you know? How do you know how many times the loop will run? Good tie in with some linear algebra here – the starting value has some connection to y-intercept and the increment each time has a connection to slope or rate if you choose to go there. There is one card that will freeze the program because it gets stuck in an infinite loop, and it’s an important one to discuss as I always have students that take some time to understand the idea of the infinite loop.


I also have a Kahoot! quiz on variables and expressions, without loops/conditionals or anything like that. Might be a good review activity.

I’m working on adapting some of my older Kahoot! quizzes from the Khan Academy Processing JS to the stand-alone Processing, but here they are if you are interested in the Khan version.

Khan Kahoot! on conditionals and booleans:


I had this one to quiz students on the draw() loop and how it affects variables. I don’t think I’ll adapt it for Processing but it might be useful to someone.



What are some of your ideas for differentiation, discussion, extension and review?


Teaching event-based programming – a traffic light

Recently as I was looking through my blogroll, I read Mark Guzdial’s review of the Framework. I wished I had been able to review the framework with a group – I didn’t feel that I generated great ideas about it on my own, but I did like reading Mark’s. Reading my social media feed sometimes impacts what I’m going to teach. In this case, Mark made a point about models of computing:

Great research by people like John Pane at CMU has shown that novices think of programs as responding to events, being reactive (e.g., think apps, games, GUI interfaces). Thinking of computing as input-processing-output is an older model, difficult to understand, and less common today.


Huh. I had been teaching programming as input –> do stuff –> output and wondering to myself what to do when this model broke down. I never really thought about how I teach event-based programming differently. I decided I would give it a try, though. In my 7th-8th grade CS class, my kids had learned about variables, conditionals, and functions. Normally I would plow right into iteration but I decided to take a detour and do some activities with the kids on event-based programming. We did a couple of examples working in Processing with draw() and mouseClicked() and keyPressed(). I decided to introduce an activity involving a state machine to teach the difference between linear programming and event-based programming.

I talked with the kids about how many of us think a traffic light works. We see it as a linear set of steps.



But in reality, we know the traffic light has a set of sensors. And when a sensor is tripped and other conditions are met, then the traffic light advances to the next state. You can model the state with a variable. In this case, I used “lc” for light color. We can model the sensors with button clicks and key presses.


We wrote this program together, imagining that the mouse click simulates a timer expiring, and the space bar simulates the sensor that detects your car. I did this as a teacher-led launch. Kids followed along and ran their programs. Easy.


The kids asked about how you simulate a real timer. In Processing, there isn’t an easy implementation of a “delay” function, so you have to poll for a timer. There is a built-in function millis() that returns the number of milliseconds since the program had started. The kids played with the millis() function and had fun writing the time to the screen. So for the next class, I decided a program that used timers would be a good extension and problem-solving activity.

In the second class, we looked at this state machine model.


My amateurish drawing shows looping arrows where you are polling the timer. As long as the “ready” variable, for example, is 0, then the light stays the same. As soon as the “ready” variable changes to 1, then you can advance to the next state. You can check for “ready” by doing some math on variables that store the value of millis(). One variable stores millis() over and over again. Another variable only stores millis() when the state has just changed.

I put the kids with a partner and made this a pair programming assignment.  We reviewed the norms of pair programming. I gave them a starter program that just showed a red screen and used the millis() function to display the elapsed time. I had some variables in the program but did not tell the kids how to use them. Their task was: turn the program into a timed traffic light. It should turn the red light on for a certain time, then the green light for a longer time, then the yellow light for a very short time, and then go back to red.

This is the starter program.

// 0 is red, 1 is yellow, 2 is green 
int lc = 0; 
int ready = 0; 
int oldms; 
int newms; 
int elapsedms; 
int interval; 

void setup() 
  ready = 0; 
  oldms = millis();
  newms = millis(); 
  elapsedms = newms - oldms; 
  interval = 5000; 
void draw() 
  if(lc == 0) 
  else if(lc == 1) 
  else if(lc == 2) 
  newms = millis(); 
  elapsedms = newms - oldms; 
  text(elapsedms, 150,150); 

The kids split into pairs and started working. After a while, a few groups were close – they could check for a certain elapsed time and then change the light’s state variable so it switched colors. They didn’t know how to reset the timer, so after about 20-30 minutes, most of the kids could change red-green-yellow and then didn’t know how to get back to red.

So I did a catch-and-release where we talked about the polling loop.  I showed boxes that represented the values of “oldms”, “newms”, and “elapsedms” each time through the draw() function. Some kids figured out on their own that the way to reset the timer is by assigning “oldms” to millis() when you change the light’s color. Others figured out different solutions  and it was interesting to see what they came up with.

The activity took most kids until the end of the class. On the third class, I asked all of the pairs to copy and paste their programs into OneNote. I then called up several groups to do a walkthrough of their solution. They did a really good job presenting. I like OneNote for this kind of sharing because the rest of the class could copy the code and run it to understand what the presenting group did.

Here are some of the solutions! I liked how each group approached it a little differently. Some used my variables and some made up their own. Some used nested “if” statements and some used complicated boolean expressions. Some reset the timer after each state change and some waited until after a complete cycle of the traffic light.

Luke and Andrew’s Method

Anna and Kay’s method

Ryan and Parker’s method

I enjoy seeing the students have their lightbulb moments, and it’s also fun to have the overachieving students that can’t resist being a little creative with their programs.

Maya’s Traffic Light

Ben and Anthony’s Traffic Light with car (it stops on red, goes on green, and speeds up on yellow)

I liked this workshop model with the teacher-led launch, the worktime in pairs, and then the student-presented summary. I think it was a good problem-solving activity for the kids, and for me it was a nice departure from the input-stuff-output model of programming.




Creativity and the Coordinate Plane

I’ve been teaching a 7th and 8th grade Computer Science Exploration class, going on my fourth semester now. As I always do, I am changing some things up this time. Starting with coding and then will dive into data and the internet and web design later.  In the past I’ve taken the plunge into coding once we’ve gotten background knowledge on data and information – because that’s how I learned it.

I am using Processing as the text-based language of choice this year. In the past, my first assignment was a problem-solving one in which kids had to make geometric shapes that I chose. I wanted to closely tie the learning in with math. However, since then, I came across this series of articles by and about Mitch Resnick: one of the creators of Scratch from the MIT Media Lab. He writes about the power of creative coding, here.  He also muses on the Hour of Code event, which I love but he makes some good points about. The power of computing is sometimes that you can use it to solve a specific puzzle… but often that you use it as a form of creative expression and open-ended modeling. Often you learn the things you want to learn because you are so driven to complete a project of your own design.

So for the kids’ first project this year, I put together a OneNote notebook summarizing some of the basic 2-D drawing functions in Processing. I also gave them this nice coordinate plane handout from Khan Academy.  We used it to do a few warmup exercises – for example, I would put some lines of code on the board, and they would draw what they thought it would look like and hold up their papers.

Then their assignment was “you’re going to create a free draw. You can make a character, a scene, or pixel art. Use at least three colors and five shapes. It should look like a purposeful drawing and not just random scribbles. I look forward to seeing what you make.”  It was very open. I didn’t have a specific problem in mind the students would solve. They would have to invent their own problems, and I ended up really liking the activity for that.

One student created multiple stars in different shades of blues and purples, and she had to make the same diamond shape but translated to different locations. She was determined to get it right and I heard her say “no, that’s not right” and redo her stars multiple times. She added a shooting star for effect.


Many students made pixel art and I enjoyed watching their different approaches. This student created pixel art by drawing lots and lots of squares with a thin black border around them.


Another student chose to do pixel art, but differently. Instead of drawing each square as a separate shape, he looked for bounded colored regions and used the beginShape() and endShape() functions, adding vertices.


Both students above had the issue of figuring out how big a pixel is, scaling their entire canvas and scaling and translating each pixel. They made it look easy!

I have a few students that enjoy “hacking” much more than they do planning and programming and so the activity was very different for them. For most students, this was an exercise in planning, mathematics, and attention to detail. For the hackers, they liked looking up something that was already done online and then modifying it and learning from it. One of these students found this program online.

A basic smiley face, curated from:

A basic smiley face, curated from:

He first downloaded the code, ran it and shouted “See! I’m done!” so of course you have a discussion about that and about how you can’t just turn in someone else’s work as your own. But I enjoyed seeing where he took the code from that point.
Student: Well, can I turn the smile upside down and add horns?
Me: Sure. I suspect the bezier function is the smile.
Student: Well how do I turn it upside down?
Me: These eight parameters are (x,y) coordinate pairs. You could plan it out on your graph paper, figure out what points would make the curve into a frown and then try those.
Student: Or…. I could do trial and error.
Me: I would plan it out and……
Student: Haha!! TRIAL AND ERROR!
Me: okay then.

So he did, and ended up making a very nice frowny face with horns. It became clear to me that his form of “trial and error” was in fact a great deal of pattern-seeking and mental math. Are planning and attention to detail valuable skills? Indeed. Are they his strengths? No, and he could get the job done well with the strengths that he had. Did he learn about the coordinate plane and color theory? Yes, I think he did. Maybe it’s ok to allow a kid to learn something new through their current strong skill set rather than the one they struggle with. This same student observed “In math class we use a different coordinate plane. This is really hard!” And I believe that code-switching is good for your brain.

Regardless of their approaches, the kids were really self-motivated to make a nice looking drawing. They owned the problems they were trying to solve. They got instant feedback, by running the program, on whether they solved their own problems correctly. Not everyone’s problems were of the same difficulty or even in the same domain. Many kids might have learned different things from what I intended them to learn. But did every kid learn? Yes, I really think so. Now I wish I knew how to put that magic into every assignment.

Learning to Code in MinecraftEDU with Turtles

I haven’t posted about my Minecraft class / experiment in a while, but this has been a really interesting class to work with. My Minecraft class is a 40-minute period every other day, for a semester. Our enrichment period is not graded and is intended to be a time when teachers and students learn something interesting together. For example, teachers have classes on knitting, beading, Lego robots, ultimate frisbee, fly fishing, creative writing, and film. I have Minecraft. I wanted to use the class to explore the question “what can you learn from Minecraft?”

Since I’m a CS teacher, one interesting teaching tool that jumped out at me was the ComputerCraft mod (See a Video here) and the Turtles. I could see them as a unique introduction to programming and computational thinking. I had my class do the Turtle Island mission (which took four classes) and Turtle Canyon (which took two).  We enjoyed these pre-created missions. As a busy teacher, I was happy someone else took the time to create them and that they were so engaging and interesting for the kids. Many of the kids “died” multiple times and just kept trying to use their turtles to solve the puzzles.

The spawn point for Turtle Island. We had to install the CustomNPC mod on everyone's machine before we could use it, but the payoff was worth it because the characters help you with the missions and give you rewards.

The spawn point for Turtle Island. We had to install the CustomNPC mod on everyone’s machine before we could use it, but the payoff was worth it because the characters help you with the missions and give you rewards.

Next, I downloaded a world from the server that had ten building areas (Actually, it was this Volume Challenge with the extra buildings and things removed). I assigned the students to a numbered area with a small group. The world was set up so the students could not build or dig – but turtles could. I filled their inventories with supplies and gave them a short program to copy, and for three or four classes they could build whatever they wanted with the turtles. When you give middle-schoolers a prompt to “build whatever you want”, you get some fascinating things.

Many students used turtle remote mode almost exclusively. Some wrote very simple programs. But then some got a little more courageous with programming and made some interesting things with the turtles.

Houses, farms, pyramids, a strange creation of black wool, all made by turtles.

Houses, farms, pyramids, a strange creation of black wool, all made by turtles.

One group seemed to have a program to build a level of a house, and they ran it twice to get this weird structure with floating walls. Another group had a program to create walls and another program to create stairs. They ran this program anywhere they could.

One group seemed to have a program to build a level of a house, and they ran it twice to get this weird structure with floating walls. They also leveled their ground with the turtles. Another group had a program to create walls and another program to create stairs. They ran this program anywhere they could.

Most of the programs were very simple, but I did see some experimentation with nested loops, and with programs calling other programs. I wonder what kind of reasoning skills we’re building here. Why 19? Why 40? So many questions.


Nested “Repeat” blocks in the graphical turtle language in Minecraft. This program uses move and place blocks to build… four walls?

I am currently teaching some turtle lessons to my Robotics class, justifying it by telling myself “they’re virtual robots”!  This has some advantages over real robots – no parts to throw or break, for example. This is a graded class and so I have to approach it differently. I’m still working out how I am going to assess their knowledge of robotics principles via Minecraft. I will create a final project assignment. What should the guidelines and expectations be for a Minecraft robotics project? I am making the class more academic by including lessons like this one.


Kids used the link above and analyzed the programs, and made predictions about what they do. Then I opened Turtle Canyon and found each of the turtles with the programs in the document, and we ran them. We took another look at the code to match what the turtle did with the code. The group discussions helped me understand the programs a lot, and I hope to see the robotics kids being more adventurous with their coding as a result of the lessons.

You learn other things too, besides programming – and it’s what makes Minecraft such a confusing, but enriching, world to play in. I love it when lessons are nice and tidy and you have a certain goal and you’re laser-focused on that goal. But in Minecraft, you have to stay flexible with your goals. Some days, you’ll learn about robotics. On some days, you will learn anger management. Some days, teamwork. Some days, resource management. Self-advocacy. Information literacy. Conflict resolution. General persistence and resourcefulness. So I have to keep in mind that if a kid didn’t make much progress with programming, it was because their learning was happening in another area.

I leave you with this picture of my pixelated students interacting with their turtles building a house.

Turtles... so darn cute and programmable

Turtles… so darn cute and programmable

Booleans and Conditionals – Lessons and Reflections

Ask a CS teacher about a main goal of their course, and a lot of us say we want kids to be able to plan and write a program independently. And that it’s a discouraging but real part of the job that many don’t.

I really take that mission seriously, and as a result I move really slowly through topics.  I’ve mentioned before that I take weeks just to teach variables. This post contains a sampling of some of my lessons on booleans and conditionals.

Lesson 1: Structure and purpose of boolean expressions and conditionals.
Objectives: Identify the boolean data type and describe the rules that govern booleans, including logic operators.
Identify and describe the structure of the “if” statement.

We started by analyzing code samples and then modifying them – first with a partner, then whole-class. I created one that introduces the boolean data type and another that uses a variable and an “if” statement to simulate a coin toss.


That said, I’d love to have a protocol or a structure or organizer for code-analysis problems. If you have one you like, I hope you share it!

Lesson 2: Prisoner’s Dilemma

Objectives: Use boolean expressions and conditionals to create a program that models a situation.
I love this lesson and have blogged about it before here.  Kids used Processing standalone instead of Khan Academy this year, but the task was pretty much the same. This is a pair programming activity. The “release of responsibility” is very gradual.

Lesson 3: Button Clicks

Objectives: Describe an area of the screen with boolean expressions.
This lesson has a very clear mapping to Common Core math standards. In Algebra, students are introduced to solving inequalities and also systems of equations. Later in high school math, students move to solving systems of inequalities.  When you create a clickable button, you’re describing the coordinates that are included in the ‘button’ as a boolean expression, which maps nicely to a system of inequalities.

Here’s the starter program.

We start with the mouseClicked() function incomplete and discuss as a class how to finish it. We look at the coordinates, height, and width of the rectangle and consider some x,y coordinates that are inside the rectangle… and some that are outside. Then we try to come up with a general sentence for which coordinates are always inside the rectangle. The x-coordinate must be between 150 and 350. The y-coordinate also must be between 200 and 300. If all of the conditions are true, you have clicked inside the box. If even one is false, you have not clicked in the box.

Then I give the kids a challenge:  create two buttons, one in the upper-left quadrant, one in the lower-right. Make something “happy” happen when you click one of the buttons, and make the other one produce something “sad”. They made some clever creations and had fun with it.

Alex P’s “Two Button Task”

Lesson 4: If/then quiz

The “quiz” task is individual, so at this point the students no longer get to work with a partner and must create a program solo. I make this task easier than the pair programming tasks, with the goal of every kid writing their own program from beginning to end.

This task is pretty simple but ended up requiring some good thinking from the kids.


In a sports tournament, the tigers will play the lions, and the eagles play the hawks. The winners of these two games will play in the championship.

These 4 variables represent the scores in the first game.
int tigers;
int lions;
int hawks;
int eagles;

Write a program that will write the names of the two teams playing in the championship. If there’s a tie in either game, you should write a message explaining that the game goes into overtime.

Although it’s a quiz, if a student raises his or her hand, I help. I help by asking questions – something I studied hard at when I was a math teacher.  The goal of the questions is to determine just how much help they need and give only that. Ask:

  • Read the problem to me again. What do you understand so far?
  • Where did you get stuck?
  • Under what condition would you write “tigers win”?
  • What causes a tie?
  • Tell me your best idea so far?
  • Can you translate that into code the computer can understand?

By the time the quiz comes around, there are definitely still misconceptions all over the place and it takes time to work through them all. Some of the ones I run into:

  • Writing a boolean expression in words, such as “tigers less than lions”
  • Mixing up > and < signs
  • Confusing equality (==) with assignment (=) operators
  • Not closing text strings with quotes (shows more than just a syntax problem – they’re not seeing the text string as a single entity)
  • Confusing the variable name with text (e.g. lions vs. “lions”)
  • Not yet understanding the purpose of variables as an “input” to the problem that can change. for example, a student may write this code, which renders their variables pointless:
    lions = 14;
    tigers = 10;
    if(14 > 10)
    { text(“lions win!”,50,50);}
  • These are misconceptions where the students are, at some level, not getting the point of a CS concept. Mistakes abound also such as syntax errors. These are different kinds of problems and have to be treated as such… I have a couple of students who generally get the CS concepts but they make tons of syntax errors. I have no problem looking through their program for the semicolons and spelling errors and just fixing them quickly. A kid who is not getting a concept, though, needs more questioning and more work.

When I taught math, one of our big ideas in 7th/8th grade was the “two-step linear equation” and how to solve it. I learned over time there are no shortcuts to mastering this concept. Sometimes there were many kids in the room who just needed me to sit with them, and one on one, watch them solve the problems in great detail and give them feedback on that work. These early programming tasks require the same attention from me. Many students just need me to sit with them, one on one, and talk with them as they program and solve. It’s a time-consuming task – in the moment, you think to yourself this lesson clearly bombed – the kids can’t program independently and I’m just doing damage control. But I have noticed as I have taught this age group more, that the early work pays off by the end of the semester. By the time kids are done with the class, you give them a simple task with conditionals and they just pound it out with barely any effort. Even the struggling learners do learn to program independently. It just takes more time and practice and attention for some kids than others.