Tag Archive | computer science

Learning Python with the micro:bit

This is such a big year for middle school computer science. I think that finally, for grades 6-8, there is a whole menu of really high quality teaching resources – from hardware tools to lessons and tutorials to standards to whole curricula. I’m pretty much changing how I do EVERYTHING, which is exhausting but exhilarating at the same time.

In the standards area, there is a new set of standards released by the Computer Science Teachers’ Association, or CSTA, located here. They are very good overall, building from grade level to grade level, organized by concept and very clear. I think it gives a nice progression for students. Many states, my own included, are involved in efforts to develop statewide standards, curricula and resources. It’s been great to see CS education move forward and the middle-years progression is really coming together.

As far as curricular resources, there are a few great new options. Code.org has a middle school course called CS Discoveries. I didn’t get to attend the training this summer, but one of my co-workers went and although she’s not a programmer by background, she came out feeling excited and confident that she could teach the curriculum and do a good job. It’s very well done so that pretty much anyone can take it and run with it.

The middle years are a great time to introduce kids to physical computing, the idea that you use algorithms and code to program devices in the world around us. It’s such an important tech literacy concept! The CS Discoveries course uses a platform called the Circuit Playground from Adafruit. For a long time, I’ve enjoyed the Sparkfun Inventor’s Kit and its little curriculum. I’ve also noticed a lot of buzz around the UK’s platform for introducing kids to physical computing – the BBC micro:bit. They are cheap and very engaging. I ordered a class pack of them, and from Sparkfun the price is really reasonable.

The BBC micro:bit Go bundle I purchased from Sparkfun.

I teach block-based programming to the sixth-graders and then work with the older middle schoolers on transitioning to text-based programming. For the younger kids, I was thrilled to find an entire CS curriculum for the micro:bit published by Microsoft. It is so good! I love its emphasis on “making” and creativity, and I enjoy the little unplugged activities. I was skeptical of them at first, but every time I try one of the unplugged activities I find the kids really enjoy it and it does help the concepts stick better. The curriculum is easy to follow, and I find the kids love finishing the lesson and then just playing with what they can do on the micro:bit.

I’m finding I can’t do some of the “invention” activities, because I only have one class set of micro:bits and they’re shared throughout the day. I can’t have kids mount the micro:bit in a pet or wearable, for example, because the next class needs them. That’s really a bummer – being a maker involves more than just code. I might try to do an invention project with the kids with the caveat that the enclosure has to let you insert and remove the micro:bit easily. We will see how things go this semester.

As you can see from the title of this post, one of the things I’m playing with is teaching text-based programming via Python to the seventh- and eighth- graders. I was not lucky enough to locate an entire curriculum for this, but there are some good resources out there. I am using the micro:bit python editor. You have to save your files locally instead of in the cloud, and actually this really beneficial. The students I have this year have had laptops in their classrooms since 2012, so they’re “digital natives”. But they’re so used to Google Docs and such that they sometimes don’t have a concept of what a file is or where it is actually stored. So we’re learning about local storage, networked storage, removable storage and cloud storage and figuring out how to access a file from different locations.

There are a lot of tutorials and a good reference at this site: micro:bit Python documentation. It gives a nice introduction to the different features of the micro:bit, but it doesn’t really teach Python. So I’m stitching together my own curriculum and put together these exercises.

In Lesson 1, we just wrote the normal Hello World program and the students were tasked with writing a program that displayed text and images, using some of what they found in the documentation. This task also involved uploading a program to the micro:bit and saving the file in local and networked storage.

# Add your Python code here. E.g.
from microbit import *


while True:


In Lesson 2, we reviewed Python syntax and common mistakes and troubleshooting. We introduced the terms “function” and “parameter” and saved some notes on these. We talked about the “while True:” loop and why the indentation is important. It’s not just picky – the indentation communicates important things to the computer! How will it know which steps to repeat without some way of blocking them off? Then we introduced variables by making a little program that displays text that changes. Students guessed at what it might do, and then we ran it and tested the hypotheses.

from microbit import *

name = 'Dawn'

while True:
 name = 'Tyrone'


Next in Lesson 3 we made a little counter program and demonstrated the difference between the string and text data types. Students could modify it by adjusting the starting value, displaying only evens, only odds, etc.

from microbit import *

# declare a variable and assign it to a value. 
counter = 0

while True:
 display.scroll(str(counter), 50)
 counter = counter + 1

By the end of this lesson, some students were feeling frustrated at how hard it was to load files, save files, upload to the micro:bit, figure out where the errors were and so on. But these are short programs and the debugging isn’t hard once you’re used to it. Students have to read the error on the micro:bit and it tells them which line the problem is on. They need to pay attention to little details and that can be exhausting, but it’s so important to give clear instructions to a machine. The machine can’t guess what you mean! We talked about how hard it was for them to write their names when they were children. If you think about it, it’s a long process! There can be dozens of little steps involved in writing your name and they were pretty bad at it when they first learned. But over time the steps became automatic and they got better, and now writing their name is a very simple task. Same with coding and debugging.

I could tell students were jonesing to make something that looked like a game. I decided to introduce random numbers as our next concept. So in Lesson 4 I had student volunteers pretend to be human variables, and we modeled what it would look like to write a program that multiplied random numbers together. First a random number is assigned to variable a. Then a random number is assigned to variable b. Then a and b report out what they are, and they are multiplied together and the result is stored in variable c. We report the result from variable c. Kids acted this part out.

Then we wrote the program together.

from microbit import *
import random

bob = random.randint(1,10)
jeffrey = random.randint(1,10)
wilma = bob * jeffrey


Many kids wanted to adapt their program to include a “forever” loop and keep producing random math problems as long as the power was switched on. By now they understood why the indentation worked, so when I suggested a “while True:” loop with everything indented after it, they were able to add it on their own.


Lastly, I wanted to introduce them to the coordinate plane on the pixel grid. For Lesson 5 I set out 25 pieces of paper in a 5×5 grid shape. I asked for one student to be a “pixel” and another to give directions. The student giving directions had to pick a random piece of paper, and in as few instructions as possible, tell the pixel where to go. We did this a few times and then I suggested that we make the paper in the top-left corner be (0,0). Then we realized we needed a sensible order for the row/column coordinates, so we defined “x” and “y”. We found out quickly that the pixels could only go from 0 to 4 and that 5 was off the grid. Lastly we introduced a “brightness” parameter, so when the instructor student commanded a pixel, they could tell the pixel student to go to an x coordinate, y coordinate, and to squat or stand according to a brightness level. So then we wrote this simple program and I reinforced the terms “function” and “parameter”.

from microbit import *
import random

while True:
 display.set_pixel(2, 3, 9)
 display.set_pixel(2, 3, 0)


And then we modified it to use variables instead of fixed numbers and the kids really liked the pixel dancing around on the grid.

from microbit import *
import random

while True:
 x = random.randint(0,4)
 y = random.randint(0,4)

Note I haven’t done much in the way of assessment other than conversations and verbal questions.. so we’ll have our first quiz task sometime next week to see how this is coming along. I don’t regret the direct instruction, though. The kids are finding it valuable, and they’re enjoying the micro:bits and learning what they can do with them.  They want to make games such as pong and snake, and I think once we understand how to use the buttons, radio and accelerometer, they’re going to have a really good time making things they haven’t yet envisioned. I’m learning right along with them. They ask me a ton of questions and my stock response is “I just haven’t learned that yet. I guess we will learn it together.”

It’s fun though. It keeps you young.

Some of the younger students enjoying coding.






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?

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 K12CS.org 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.




Arduino Final Projects by Middle Schoolers

This was my 3rd semester teaching an Electronics class for 7th and 8th graders, and I’m learning more and more every time I teach it.  In this class, I want students to learn the basics of electricity, circuits, and programming – and I also want them to learn a maker mindset. How to invent, remix, tinker, recover from setbacks, persist through difficulties, use your resources, collaborate with others. How to teach yourself what you need to know. How to present your project to others so they can build on it and make it even better.

I use some formal lessons, but this class is not as structured as a programming or computer science class. For the most part, students are given resources and inquiry questions, and they use the resources to teach themselves what they need to know. Everyone starts in a different place. Everyone has different needs. I want them to create something challenging that they’re proud of – a launching point for future exploration and learning in the world of invention.

I love the projects the kids made! Many made interactive holiday displays, and I got a great variety of others including videogame-themed projects, an LED cube, games, and even a car.  I created a simple Google Sites page to showcase their work.



I also have some reflections on the semester and the class in general. The learning is just as good for me as it is for the kids.

  • Purposeful learning: I believe in giving the students a good foundation in circuits such as understanding measurements and parallel and series circuits. However, students report to me that they find the beginning of the class “boring” and I don’t think I connect it well to the Arduino projects later. I’ve been involved with a project called Engineering Brightness, spearheaded by Tracey Winey, our media specialist, and John Howe, our assistant principal. It’s part extracurricular and part co-curricular, where students build lanterns in our school’s makerspace to send to third-world countries. My kids get involved with the EB program through soldering lessons, field trips, and guest talks and Skype sessions, but it has not been fully interwoven into the class up to this point. Tracey and I have been planning to co-teach this coming semester – we’ll use the EB project to teach basic circuitry and the innovator’s mindset, and infuse cultural/global awareness into Electronics class. I’m really excited about making this partnership stronger. The kids will understand the circuitry much better with this style of learning. Imagine learning about serial and parallel circuits, volts and amps by designing your own lantern for other people. They will love what they’re doing and find it more purposeful. There’s a good body of research that shows this is how to draw girls into engineering, too.
  • Open-source culture: The open nature of Arduino is what makes the platform so beautiful to work with. I have encouraged students to remix found projects and to share their work, but haven’t really tapped into the community to make their sharing more real. One thought I have here is that there is a style of communication that comes with sharing projects. Look at good projects you find on instructables.com, or ehow.com, or youtube or any of the Arduino sharing sites. Look at some that are not as well done. There’s a structure and a style that makes your project accessible, interesting, replicable, and fun. Kids in the modern world need to learn to communicate in the medium that best suits their work, to code-switch and adapt their style as needed. I wonder how to teach open-source sharing and communication to middle schoolers. I would love to make the writing and video editing and photography and commenting a really key part of the class, as I’m not satisfied with the work I’m getting at the moment. It would be so important for the Engineering Brightness part of the curriculum as well as the Arduino part.
  • Appropriate level of challenge: I ran into challenges you always run into with a project-based class. Some students got in over their head and tried to do too much. Some kids who were perfectly capable of finding answers on their own raised their hands many times each class and waited for me to help them. Some finished early with a half-baked project that didn’t meet requirements but did not want to challenge themselves further. Work was shared unevenly between partners. Some finished early and asked me what they should do for the next three class periods. Some pushed the deadline right up until the last minute of the last day of class. Some did not understand how to read rubrics or project guidelines. I expect all of these challenges each semester, and sometimes I do a good job working with these situations, but not always. I continue to look for good structures for project-based learning. It’s really hard with one of me. This may be a great opportunity for me and my teaching partner next semester to put some good practices in place for the kids.


Computer Science Education Week at Preston

I’m late blogging about this because our days were so busy with CS Ed Week! I owe a huge debt of gratitude to my partner in crime, Tracey Winey (Twitter: @premediawine) , who listened very nicely when I said “I have some ideas about Computer Science Education Week I’d like to brainstorm with someone”, and she agreed to dive right in and plan a bunch of activities with me. She’s an outstanding organizer and is becoming a darn strong engineer as well, so the world better watch out.

We arranged for teachers to do an Hour of Code with their students over the course of the week, in their regular classes. Many students are doing multiple Hours of Code and they love it. The three activities garnering the most positive feedback from students are the Minecraft Hour of Code on code.org, the Anna and Elsa Hour of Code on code.org, and the BitsBox Hour of Code (which actually lets you download your apps to your mobile device!). I love how the Hour of Code makes coding accessible and fun for every student. Tracey and I wanted to infuse coding into a little bit of a cultural celebration at school. We envision that students should not see coding as a niche activity for a geeky few, but as a normal problem-solving tool that everyone uses.

We set up some open houses in the media center and scheduled students to come to them and take tours. We arranged for current CS and Electronics students to be tour guides and take their friends around different “exhibits” having to do with computer science. Tracey managed the open houses as I had classes to teach during most of them. We had:

Interactive Code, Art, and old Video Games on Monday:

That is PONG, people.

That is PONG, people.

Arduino Day on Tuesday:

Experimenting with a reaction-time game and a pac-man simulator on Arduino.

Experimenting with a reaction-time game and a pac-man simulator on Arduino.

Robot day on Wednesday:

Students love NAO robots and Lego EV3 Robots.

Students love NAO robots and Lego EV3 Robots.

Minecraft day on Thursday:

An Hour of Code with Minecraft Turtles in the lab. Very popular workshop.

An Hour of Code with Minecraft Turtles in the lab. Very popular workshop.

On Friday, we had our first annual Preston Middle School Code-a-Thon. I blogged about how we envisioned it working previously.  We were able to accept almost 80 kids, and it came down to 11 beginner teams and 8 advanced teams. The beginner participants were mostly girls, and the advanced groups were half girls. It was busy but a lot of fun.

We recruited some adult volunteers from the community… some Preston parents who are engineers, along with some engineer friends and retired teachers, and a staff member from the Larimer Humane Society. We had four judges and eight technical mentors, and we divided them up to work with beginners or the advanced teams.

Tracey and I gave a presentation about the code-a-thon. We talked about how code-a-thons are also called hackathons, and they are engines of innovation. Google is famous for its hackathons, and hackathons usually have a theme – Virtual Reality, Rural Life, and Social Services are a few. Sometimes, employees even stay overnight and bring their sleeping bags, and code through the weekend to come up with their solution. Everyone presents at the end. We presented the theme:
Animal Welfare!  The kids were very excited. We showed this quick YouTube clip to get the students thinking about different problems they could solve related to animal welfare.

The kids started by brainstorming, and Tracey set them up all over the media center with SMART boards, regular whiteboards, a SMART table, a Kapp, butcher paper, desktop computers and laptops. The kids had to choose a problem or a need to address, and what language they would code in. I had set up some group accounts on Khan Academy, Open Processing, and Scratch. One group of students chose to use MIT App Inventor, one chose BitsBox, and three groups decided to create coding solutions using the NAO humanoid robot.  We offered snacks every hour, and had the kids turn their programs in using Google Classroom. They worked from 8:15 until 11:15, and then they gave presentations to the judges. We saw programs on animal abuse, factory farming, saving penguins, catching poachers, endangered animals, quite a few perfect-pet quizzes, a vet program, and a robot dog trainer. While the judges were deliberating, our Humane Society volunteer gave a presentation about what they do and how they help animals in the community. Finally, the judges returned and we gave out top-four prizes in each category.

It was awesome. The kids who gave us feedback said they loved coding something that had a purpose to it. That they really enjoyed having a reason for coding, learning and being social and of course having snacks. I heard from a couple of parents of beginners that their kids were so proud of their coding and had so much fun. Many kids asked if we could do it again. We are pretty exhausted – but we probably will!

Here is a link to many of the programs created by students during the code-a-thon.


I hope you like this slideshow of the code-a-thon. We had a great time!

This slideshow requires JavaScript.

First Annual Code-a-Thon for CSEdWeek

Computer Science Education Week is quickly approaching, and this year we want to go a little beyond the classroom hour-of-code events (which we are still doing). My school has decided to host its first mini-hackathon, which we’re calling a code-a-thon! I have seen announcements for hackathons in my area before and the idea is always intriguing, but I’ve never actually attended one – so this is a big leap, hosting one without ever actually seeing what a hackathon is like. Our awesome media specialist and I are pulling it together and hoping to learn from the experience.

Here is what we have decided so far.

  • We will have two categories: Beginner and Advanced. Beginners can be complete newcomers who have never coded before. Advanced coders have a semester of computer science or the equivalent.
  • Teams will be 3-5 students.
  • First thing in the morning, we’ll make introductions, set up norms, and reveal the theme. The theme will be very broad (the examples I use with students are “sports” or “space exploration”).
  • Students will have 20 minutes or so to brainstorm what they would like to make.
  • They can make anything they want as long as it has to do with the theme, and it is created with code. Any coding language is fine. We will provide access to robots and Arduinos if they wish to use them. Students can use Scratch or Code Studio, or Python or JavaScript or any other language. Web design tools such as Weebly do not count as “code” but can be used to enhance their project. Some ideas include games, interactive flash cards, simulations, trivia, animations, educational programs, etc.
  • We will provide some technical mentors that can help students. Students will get a token or a flag they can turn in to receive a certain amount of time with a technical mentor. They should use it when they really need it!
  • We’ll have breaks for snacks and drinks and movement.
  • Students will get to present their projects to the judges for a short amount of time (3-5 minutes depending on number of teams).
  • Judges will score projects in these categories: Problem Identification / Requirements, Usefulness of Solution, Creativity, Teamwork, and Technical Quality.
  • Winners will receive prizes. Everyone will get food and publicity.

I teach a required sixth-grade tech class so I’m able to pump it up and give the code-a-thon some good publicity in class. I have also appeared on the morning announcements to advertise and give computer science trivia questions. I set up a table at lunch with some signs and sign-up forms.

The turnout was amazing! 116 kids signed up!  63 of them were girls! We are going to need to actually cut some kids from the code-a-thon… what a bummer, but what a great problem to have!

Signing up for the code-a-thon. Groups of friends registered together.

Signing up for the code-a-thon. Groups of friends registered together.

We’re excited to see how the event goes and what kinds of programs the students create. My vision is to create a culture at the school where computer programming is seen as a normal problem-solving tool used by everyone, and not a fringe activity for supersmart kids. I’m so, so encouraged by what I have seen with the code-a-thon signups. Really fun to see kids round up friends at the lunch tables and bring everyone over to register to spend a morning coding. I hope the event goes well, and I will definitely post updates as we get closer!


Microsoft Underground Part 2: The Conversations

In an earlier post, I talked about the Microsoft Underground tour and workshop, and the technology we saw – Skype, Minecraft, the BBC micro:bit, and others. In this post, I want to dive deeper into why it was important – what’s in store for the future of education and what conversations are happening there.

The Purpose of Public Education

The group of people brought together for the workshop was interesting – a few of us are classroom teachers, and there were also educational technology specialists, leaders of ed-tech startups, students, bloggers and thought leaders. It was just as fascinating to note what was NOT said as what was said. We shared many thoughts about how to educate students in a creative, engaging, collaborative way. But the question of “why?” or “should we?” never came up. If you don’t live and work in the public education system, it’s a given that a kid’s education should be relevant and enjoyable, rigorous but creative. However if you gather teachers and administrators in a room, the subject of our conversations will be why and whether we should teach more creatively. The “real world” is ahead of us on this idea.

We also never brought up content standards and only mentioned test-based accountability a little. Again, if you gather teachers and administrators in a room and discuss improving teaching and learning, I guarantee we’ll mention test scores and discuss mapping to content standards. In our world, a quality education covers standards and is demonstrated by outstanding test scores, and if it happens to be engaging and creative, I would say that’s seen as a bonus. At the Microsoft workshop, the desired outcomes of our educational system were mentioned in the context of the four “C”s of a 21st century education: collaboration, communication, creativity, and critical thinking. This difference in mindset between the educational world and the rest of the world is important. Whether we want to admit it or not, for teachers and administrators, the purpose of our work is to meet standards and achieve decent test scores. The four “C”s are seen as a means and not as an end, or a bonus if you can find a way to fit them in.

Accountability, Metrics, Motivation to Change

In our conversations at the workshop, a common question was how to get teachers to more widely adopt innovative technologies and curricula in schools. There are many barriers, and test-based accountability is definitely one of them. Our success metrics are all wrong.

In some turnaround schools, kids get ONLY math and reading instruction and learn no science, social studies, or enrichments because of the need to bring test scores up. Would you want your child to go to a school like that? Yet teachers and administrators understand their metrics and strive to be seen as successful.

We talked about a common scenario in which teachers will visit an innovative classroom, say “Wow! I want this in my classroom! How do I get started?” And they try a more creative, collaborative, project-based lesson format for a while. And then they discover it’s difficult, and messy. The kids haven’t learned how to self-regulate their behavior or manage conflict, they’re not used to being self-directed learners, and there is no control in the classroom. If you aren’t committed to the effort, and your test scores are reasonable and nobody is making you change, it’s an easy call to quit. Put the desks back in rows and get out the textbooks and worksheets again. As Jim Collins says, the enemy of great is good.

I don’t see long-lasting change happening in classrooms unless metrics change. So what would 21st century metrics look like? I got an opportunity to brainstorm with Margo Day, the VP of US Education at Microsoft. Margo is awesome. She has immersed herself in the educational world to understand our model and gets it. I suggested we need the voice of tech companies in changing accountability systems. Big companies have a huge voice, and a more immersive and collaborative model in education benefits them and also the kids. She pushed back at first. Standards and accountability systems aren’t really their role, and I can see where she’s coming from, as it’s not in their business model or core expertise. As we talked more, we started to explore the possibilities in that space. What would an accountability system look like that really moved education forward?

Can you use mastery-based systems that level students up when they have achieved basic skills at a certain level?
What would you get if you asked schools what their students have created that year?
To what extent do you use student voice on how engaged, safe, and appropriately challenged they felt at school?
Can you keep basic standardized tests at a dialed-down level of stress and time?
What does actual college- and career-readiness look like and how do we know if we’re moving closer?

My district’s superintendent, Sandra Smyser, took a line from Jim Collins in her opening speech to our district last year, while unveiling new district goals / ends. To paraphrase, sometimes the best ideas defy measurement – and you don’t shy away from the ideas because they’re hard to measure.

We need to speak louder to our policy makers about this. Metrics drive performance. We’re measuring the wrong things.

Innovative Platforms, not Curricula

Microsoft is going to be a force to be reckoned with in the ed-tech market, and here’s why. Their vision is powerful and aligned with the potential that technology can unlock in our students. They could have come out with products that taught students skills mapped to standards, aligned to a curriculum, and focused on mastery of skills. But that’s not what they have done and it’s not what they believe in. Microsoft has created, and continues to create, open platforms. They’re endlessly personalizable, extendable, flexible. The most powerful learning tools allow the learner and teacher to create their own educational experiences, and to make a difference. Every technology we used, from Skype to Office 365 to Minecraft to TouchDevelop and more, is a gateway to possibilities. I sensed that vision in every employee I talked to. They are excited and passionate about what they’re bringing to the market. They see themselves as changing the world, and with that kind of cohesiveness and passion – Microsoft will, and you do yourself a disservice to underestimate them.

I really love the way they approach computer science teaching in cooperation with the BBC micro:bit platform. It would have been easy to look at the list of standards and come up with a curriculum, tests, and textbooks. Instead they see the challenge as how to create an open and flexible platform with which the kids can learn the key ideas through a personalized creative process. Wouldn’t it be awesome if every subject area had this philosophy?

My generation grew up with Microsoft products including Windows, Office, and Visual Studio. Today’s kids find these tools old-fashioned and stodgy, and Microsoft is working hard to win the hearts and minds of the younger generation. They love open-source and hacking and tinkering, social media and communication and creative arts. The way to the kids’ hearts is not through curricula and testing, but through enjoyable uses of technology that push the frontiers of what we can achieve. It so happens that these ideas align with good educational practices as well. This direction could be a true win-win.

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.