$ ❯ CrowderSoup

A website about programming, technology, and life.

Hour of Code

by Aaron Crowder on in Life

Hour of Code: Star Wars

Yesterday I took part in the Hour of Code at my local high school as a volunteer.In fact, it was at the high school that I attended. I had a lot of fun and I was excited to see the stundents gain a deeper understanding of code.

I was especially impressed with the number of young women in the class that seemed to really enjoy it. It’s a really common misunderstanding that people hold that girls aren’t interested in tech. I think in too many cases they are steered in other directions, towards things they should be interested in. I’m glad to have been able to give all the kids an opportunity to see if programming is a career they’d be interested in.

We did the Star Wars tutorial on Code.org (because duh, Star Wars). After a brief introduction from me I turned them lose and walked around the room answering questions. I think that was my favorite part; hearing the questions from the kids.

I think the most common question I was asked was this:

How do I make my game end when they get to a certain number of points?

It showed that they were thinking about a specific problem and going about it logically. They just needed a little help getting the code right since the Code.org workspace didn’t have a built-in way to do that. The solution I helped the kids implement was this (this is, of course, mostly psedo code:

var points = 0;
var pointsToWin = 500;

function whenAddPoints(points) {
    points += points;

    if(points >= pointsToWin) {
        endGame("win");
    }
}

I was able to compile a list of links to all their games. In the interest of privacy I’m not going to share any names here, but here’s the links to their games!