Archive | Lessons RSS for this section

Micro:Bit Curriculum

This spring, I tried something I’ve never done before – I tried my hand at curriculum writing! I had a great opportunity to work with Launch CS to create a 10-lesson curriculum for the BBC micro:bit. It’s not perfect, no product ever is, but I did end up happy with what came out of the effort. The package is aligned to CSTA standards and covers a variety of them in ways that are not typical of most coding curricula. There are a ton of lesson packages out there that introduce algorithms and programming, and I did include these but also worked to introduce networking, data, and the design cycle. The curriculum is intended for students in grades 5-8.

The highlights are:

  • Events, Variables, Conditionals, and Looping (via mini-projects and pair programming using the micro:bit)
  • Data modeling and analysis using micro:bit, electronics, and spreadsheets
  • Networking using videos, a computer and the micro:bit radio feature
  • Design Cycle via a micro:bit “Shark Tank” style project

The curriculum can be downloaded for free here, or on the micro:bit teaching resources page. I’m excited to see people using it and hope you find it useful and fun for your students!

I would have loved to see teachers at the CSTA conference, but alas, duties for my new job interfered this year. It’s on my bucket list to attend  – hopefully next year.

Until then let me know if the micro:bit resources are helpful!


Edited later because I neglected to give credit where credit is due. Grant Smith and Cheri Bortleson are amazing to work with – they gave thoughtful feedback and edits, and they formatted the curriculum beautifully with lovely graphics and a consistent theme. I can share this proudly because they did such a nice job with the vision and final project! Thank you Grant, Cheri and LaunchCS!

Advertisements

The Computer Take-Apart (revisited).

A few years ago, I wrote this post about my struggles to have middle-schoolers do a computer take-apart and meet the high expectations I had in mind for them. I am happy to report I didn’t quit doing computer take-aparts. I did try to learn from those hard lessons and continue improving on it. Hardware Week now runs pretty smoothly and kids report it’s their favorite unit. I do this set of lessons in my 7th/8th grade Computer Science Explorations class. It’s a great one for the week right before spring break, or whenever you need a little something different to mix things up.

Prior to the lesson, I ask parents if they have any old computers they have been wanting to get rid of but didn’t want to hassle with recycling them. I have a small budget I can use for hardware recycling, so I have workplace services come and take the computers away for recycling when the take-apart is done. I accept laptops as well as desktops, and it’s fun when I have a mix of both. I stock up on tools, especially small phillips screwdrivers, flathead screwdrivers, a few small Torx screwdrivers, some pliers and a few wire cutters.

First, we learn about the basic structure of computers (I also relate this structure to micro:bits, since my CS students learn to program them in Python). We do several card sorts in which I give students a sheet with pictures and descriptions of computer hardware, and they have to sort them into categories: input, output, processing, storage. Sometimes I include Power in one of the categories. Although pieces of hardware like the battery and fan don’t have anything to do with the flow of information, they are visible inside a computer and really important to its operation. You can find the card sort at the link below!

Lesson1Activity1wIllustrations

Next, I have the students watch a movie and fill out an organizer with it. The movie is wonderful – it’s called Lifting the Lid and although it’s from the early 2000’s, the information is still relevant and it’s very entertaining and informative. The movie is expensive to buy, but I was able to reserve it from our public library. I had to get it from Prospector as it was at a local university.

Here’s the link for the movie. The instructor’s guide, linked on the same page, is the organizer I used. I circled the most important questions for the students to fill out, and paused the movie at certain points to work with the kids on filling out the organizer.

We then have a quick safety and procedure talk about the computer take-apart. I have learned to keep the rules really short and simple.

  1. If you have a laptop, take the battery out first and bring it directly to me. Don’t take anything else apart until the battery is out.
  2. Wash your hands well afterward to avoid getting lead in your eyes, nose, and mouth.
  3. Do not break any screens.
  4. Many computers are meant to be taken apart. Look for the places where the computer has seams, screws, levers or tabs.
  5. As you remove pieces, label them. Each group will get a sheet of labels and some tape. Sometimes you may find more than one piece in a category.

I give each group a sheet with labels of computer parts, plus a couple of blank labels in case they find things that aren’t on the originals.

I circulate around as the groups are taking their computers apart and help them identify parts as they remove them. Sometimes they’re tricky even for me! When opening laptops, sometimes the easiest way to access the motherboard is to take the keyboard apart and come in through the top – which of course kids love and requires a little extra time cleaning up at the end because keys get all over the floor.

When the computers are dissected, we begin a group show -and- tell for their computers. I put prompts up on the board and ask groups to hold up a part that matches the prompt. We go around the room and every group explains what they’re holding. They rotate group members for each part. Example prompts:

  • Hold up something that stores data.
  • Hold up your CPU.
  • Hold up something that is for input.
  • Hold up something that is for output.
  • Hold up something that’s used for cooling your computer.
  • Hold up something used to power the computer.
  • Hold up something used to connect to a network.
  • Hold up the motherboard.

At the end, I do allow kids to take home a souvenir as long as it’s not a hard drive, solid-state drive, or a battery. I keep those and make sure they get recycled properly. We spend quite a bit of time placing parts in big moving boxes, which I tape up and label for recycling.

I could do a formal assessment. I choose not to. The show-and-tell is a helpful wrap-up and taking a computer part home is something the kids really enjoy as a reward for cleaning up well. I had a student tell me the other day that he took his motherboard home, set it in a frame, filled it with resin and hung it on a wall!

It has ended up being a fun set of lessons that are also great for learning. I’m glad I didn’t give up on it.

 

 

Media Literacy and Fake News

Part of my charter as the tech teacher is to facilitate learning about digital citizenship and online research. In the past I’ve used lessons from Common Sense Media and really enjoyed them. I especially love their lessons on copyright / fair use and maintaining your digital footprint.

I’ve had a few conversations with kids lately, including my own daughters, that have given me a sense of urgency when it comes to media literacy. Students love to show me funny things they encounter online and exciting or outrageous stories. Sometimes they’re real but exaggerated. Sometimes they’re total hoaxes.

One event that really made me feel a sense of urgency was when President Trump re-tweeted some clickbait videos with inflammatory titles against Muslims. The cues from the source and the video titles told me right away they were probably misleading, out of context, or possibly even fake. I’ve learned what questions to ask and so I was able to quickly realize I don’t need to be afraid of my Muslim friends or students based on the tweets. But the President is a world leader, and information coming from him carries weight. My students wouldn’t necessarily know what I do about clickbait and fake news stories. I wouldn’t want them to have bad opinions about their classmates or community members, or live in irrational fear, based on misleading information from social media. What questions should I help my students ask to really evaluate information critically? Middle-schoolers, in my experience, know about the prevalence of clickbait, fake news and bias, but they make decisions based on their gut reactions. They should start learning to look for patterns that help you make decisions about what to trust.

I started looking for lessons on fake news / clickbait / biased media, and was pretty pleased with what’s out there. Here is how we did the lesson:

Warmup: Ask students if they follow world events by reading or watching news. Most of my sixth-graders said no. Some even said their parents don’t let them watch news – it’s too upsetting (one even used the word “divisive”). Write “fake news” “clickbait” and “biased news” on the board and ask kids to share what they know about these terms. Most students are familiar with them or have at least heard of them. Some key points to bring out: fake news is completely false / made up. It might be a joke, or it might be trying to convince you it’e real. Clickbait uses an exciting title or thumbnail image to make you click, but the link usually isn’t as exciting as the title and thumbnail were. Biased news tends to be one-sided and it mixes opinions with news.
Bring out that the information economy is driven by clicks and views. The more clicks and views a site has, the more money it makes. Understanding this can make you smarter as a consumer – companies will do whatever it takes to make their link look interesting to you, so you click on it.

Activity 1: The purpose of this activity is to test their savvy at identifying real vs. fake news, and look for patterns that would help you evaluate articles in the future. Play the game FACTITIOUS at: http://factitious.augamestudio.com/#/  The game gives you a snippet of a news story and will tell you the source if you click a button. Your job is to swipe right for real news and left for fake news. Students should try to get the highest score they can the first time around. Look for tips and ideas that will help you identify fake vs. real stories the first time.
Students LOVED the game and found it really interesting and exciting. It is appropriate for middle-school. There are a couple of drug references but they’re informative and not promoting drugs.

Discuss Activity 1: Ask students what patterns they noticed that would help them be smarter about identifying fake news vs. real news. Here are some things my students mentioned. I was surprised at some of the interesting things they noticed:

  • Look at the source and see if it’s reputable (like the BBC) or not reputable (like ilovepancakes.com)
  • See if the article quotes professionals with real titles. Look for details like real locations.
  • Look at the images – are they real images of the event or are they photoshopped or stock images?
  • How is the grammar and spelling in the article?
  • Does the article use ALL CAPS or emotional language?
  • If it’s a science article, does it mention who did the study or what magazine the study was published in?
  • Use the common sense test. Read the article past the headline and think about if it’s realistic.

 

Activity 2: Identify biased news and look for ways to be a smart consumer of news. I found the website allsides.com when I was doing a search on ways to teach about media bias. I really like this site and recommend it! I selected two stories that I thought would be accessible to middle-schoolers, one from the “right” and one from the “left”, that dealt with the same topic. In this case, I chose the topic of taxes but you could choose whatever topic is relevant to current events.
Left-leaning article on tax reform bill
Right-leaning article on tax reform bill

I assigned students to read the headline and first few paragraphs of either Article A or Article B. Their question prompts were:

  1. What is the main idea of the Senate tax bill?
  2. Will this bill impact people positively or negatively?

Discussion of Activity 2: The student responses were interesting. At a first glance, only about half of the students used evidence from the text to answer the question. Should I have been more specific in the question prompt? I was surprised at how many students had an opinion on the tax bill, considering they told me they don’t follow world events. Did they learn their opinions from family dinner-table conversations or do they read news more than they thought?

We’ll have the follow-up conversation next class and this is what I want to pursue.

First, list some adjectives that convey an emotion or feeling. I’ll have the kids brainstorm adjectives like “dark”, “deadly”, “bright”, “winning”, etc.

We’ll go through the articles one more time and just look for emotion-filled words or phrases. These hint at opinions in the articles.

  • If we weren’t told ahead of time, we might not know these two articles are even about the same thing. Why are the articles so different if they are both news articles about a tax bill? [they’re about different parts of a tax bill and neither is about the whole thing]
  • The articles are a mix of fact and opinion. What tells you that you are reading someone’s opinion vs. fact?
  • What are some emotionally-charged words and phrases used in the article? Why should you be aware of these?
  • Are opinion articles useful? Explain.
  • If you don’t know your opinion about a topic and you’re using news articles to learn, what suggestions do you have that would help you be a smart consumer of news?

As a side note, I did have a hard time finding left-leaning and right-leaning articles that were written at a middle school reading level. Even with a tough read, though, I felt students could look for the general mood of the article and identify some phrases that would tip them off about the author’s opinion.

I will look for opportunities to bring these ideas into discussions as we move into break. Another interesting game I found is this one: Fake It to Make It. Some of the ideas might be above a middle-schooler’s head, but I think they’d enjoy this view into how social media gives us a really strange news ecosystem. I’ve read about college professors creating courses on how to write fake news. Maybe as a tie-in to web design or HTML, we could do a lesson on how to write a fake news story. For fun and education!

 

 

 

 

 

 

 

 

 

Making Joule Thief lanterns for a better world

My dear colleague Tracey Winey (you can find her on Twitter at @winey02  ) introduced me to the idea of philanthropic engineering – that students can make projects in class that can be useful in real-life for a good cause. Years ago, she and some other educator colleagues came up with the idea that kids could genuinely tackle light poverty – the lack of artificial light sources after darkness falls. In areas where electricity isn’t available or isn’t reliable, a nice light source can make a huge difference when it comes to studying, cooking, doing chores or staying safe. Our school and others around the world have already sent dozens of little lanterns to people in Guatemala, Honduras, Nicaragua, Uganda and other locations. You can find out more about the effort at http://e-b.io

This is normally an after-school program and my after-school hours are really limited with a busy family. This year I am getting my whole electronics class involved by having them create lanterns for Engineering Brightness. After some tweaking of the process this is where I am with it now.

  • I provide the electrical design and all of the parts, and the students pay a small class fee to cover costs.
  • Students solder the circuit together by following instructions I provide.
  • Students design some kind of case or enclosure for the lantern, by prototyping with cardboard and other household materials.
  • We will present and share the lanterns with their enclosures, and 3-D print a handful of the best designs.
  • As a class we’ll assemble the final projects and then put them in a box with some cards and photos. We will send them to either Liberia or Guatemala where Tracey has some contacts through her church.

I will share plans on how to make these if you’d like to have your class try it out as well. After we have a couple of enclosure designs, I can also share the 3-D models of those so you can print them and assemble the whole thing.

Before I get to the how-to’s, of course the big question here is what are we trying to teach the students? What do I hope they learn and how will I know they have learned it?

We’re working a little outside Colorado’s state science standards, but I don’t think every worthwhile learning experience has to be linked to standards. I also believe it’s OK if every kid’s learning is different. Here are some of the areas in which I want to see growth from the kids.

  • Understand that electrical circuits require a closed path, a load, and a voltage source, and identifying those in a real-life circuit.
  • Identify some basic electrical components, what they do and how they work.
  • After working with a design, identify ways it can be improved such as cost, size, durability and quality. Know what a tradeoff is and make smart tradeoffs when improving a design.
  • Consider a purpose of a product and improve it for that purpose.
  • Identify common electrical problems or mistakes and describe how to fix them.
  • Solder safely. Produce work that improves in quality over time.
  • Make something that will be meaningful to another person.

I based my little lantern design on a “Joule Thief”. Normally, a white LED takes around 3 volts to light up brightly – so you need two or three AA batteries for the purpose. Three are better than two, because once the batteries drain even a little bit, two won’t work well anymore. Rechargeable batteries are important because it is difficult to replace batteries in light-poor areas. The Joule Thief conserves cost and battery life by using a transistor and a ferrite toroid to make a single 1.2 volt rechargeable battery create a pulsing voltage that is enough to light an LED. It does this by making a magnetic field oscillate and it adds to the battery voltage. I go through some basic circuitry lessons with the kids, and we learn about LED’s and resistors, series and parallel circuits and what they do, and then we watch the joule thief video and compare/contrast it to a plain DC parallel circuit.

JOULE THIEF VIDEO

The students learn how to solder first by watching videos, and we take a soldering safety quiz before they are allowed to solder. Then students make their project bags and start assembling lanterns. I have had parent volunteers come in to help supervise the soldering and that has been a huge help.

I made this YouTube tutorial that shows you how to assemble the Joule Thief project. The students watch this video and pause it in spots to assemble their lanterns.

http://tinyurl.com/joulethiefvideo

 

In the video description, I’ve included a parts list and the instructions for making the circuit boards. I’ll also include it here. You just have to order some cheap electronics online, like wire, transistors, solar panels and ferrite toroids. The lanterns take one of everything, execpt LED’s. I used ten LED’s for each lantern. It’s all in this spreadsheet. You can make them for around $5 each if you shop around a little. I use eBay, Jameco and Amazon for my purchasing.
Parts List

The circuit boards are really fun to make. A couple of years ago, one of my former students came to visit me and showed me some custom circuit boards he created. He taught me how to design and upload my own… sometimes you’re the student, sometimes the teacher. The basic process is:

  • You lay out all of your components and the wiring using a program called Fritzing.
  • You export your Fritzing circuit to Gerber format. This gives you a bunch of files in a folder. If you want to use mine, you can download them here. GERBER FILES
  • You zip the folder using something like WinZip.
  • Go to Seeed studio at http://seeedstudio.com/
  • Select their Fusion PCB service.
  • Upload your zipped Gerber folder. You can use their Gerber Viewer to see the circuit board and make sure it looks OK.
  • Here’s the circuit board with the Gerber viewer.

  • Choose your options. I prefer a 2-layer board because the students get a solder pad on the top and bottom of the circuit board. My board’s measurements are 42.8mm*67.2mm and sometimes it doesn’t update correctly.
  • Decide how many you want. Place the order and it will be shipped to you!

 

Some of the first students finished soldering their circuits after about 3 classes, and they’re making little enclosures as well. I’m asking them to prototype enclosures using household items – and we’ll 3-D print the best ones. Here are some of the ideas so far.

 

I really love literal “light bulb moments” when the students finish soldering, flip the switch and the lights come on. It makes me proud every time I finish one, and I’ve done this a few times by now. It’s exciting for a first-timer.

We’ve watched some videos about Liberia and will be learning about Guatemala as well. I want the kids to start to get to know the people who will be receiving their little solar lights. Fingers crossed for a successful finish to the lanterns, and I really think if nothing else, they feel more competent and confident when it comes to working with circuits.

 

 

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 *

display.scroll('Hi!')

while True:
 display.show(Image.HAPPY)
 sleep(1000)
 display.show(Image.HEART)
 sleep(1000)

 

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:
 display.scroll(name)
 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)
display.scroll(str(bob))
display.scroll("*")
display.scroll(str(jeffrey))
display.scroll("=")
wilma = bob * jeffrey
display.scroll(str(wilma))

 

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)
 sleep(200)
 display.set_pixel(2, 3, 0)
 sleep(200)

 

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)
 display.set_pixel(x,y,9)
 sleep(100)
 display.set_pixel(x,y,0)

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:

achievement1

achievement2

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 typing.com as tools for practice. NitroType is really engaging and I really like the drills on typing.com.

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.

typing_speeds

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: http://www.steminstitutes.org/) . 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:

http://services.minecraftedu.com/worlds/node/210

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:

http://screencast-o-matic.com/watch/cD1iehiIo5

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.

turtle_program_example

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”.

turtle_program_example2

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:

https://mcreator.pylo.co/

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 minecraft.net) 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 10.13.2.1291. 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.