Tuesday, June 9, 2015

A Classroom Game to Teach Data Representation With Images

Our Gram's House team has been working on three classroom games designed to teach middle school girls about computer science principles.  One game intends to teach data representation by showing how images can be represented on computers with numbers.  Here are the current rules of the game.  These are not final—there are open questions about some individual rules, and we need to do more play testing with the target audience.  Feedback is most definitely welcome!

Materials

Each player will receive two pieces of paper.  The first will be hidden from the other player and contain an encoded image and the total number of black cells contained in the image.  The image will be different for both players.


The second page is a blank grid where the encoded image will be revealed over time.  This page will be placed on the table where everyone can see it.  Each player must copy the total number of blacks in her image onto this page.


Each player also needs a pen.

Rules

Players alternate turns, with the youngest going first.

On her turn, Player A calls out a row number and column number.  Player B then takes one of the following actions:
  • If the cell on Player B's publicly revealed image is blank, the colour of the cell will be revealed.
    • If the corresponding cell on Player B's hidden image is a 0, Player B places a dot inside the cell on the revealed image to indicate that the cell is white.
    • If the corresponding cell on Player B's hidden image is a 1, Player B colours the entire cell with her pen to indicate that the cell is black.
      • When the revealed cell is black, Player A gets to call a second row and column, which can be for the same cell or a new one.  This happens only once, and only when revealing a black cell for the first time.
  • If the cell on Player B's publicly revealed image is already revealed as a certain colour, a run of cells directly to its right is also revealed until the colour changes, or the row ends.
    • If the very next cell is a different colour, nothing new is revealed.
Winning the Game

A player wins the game if the public image of their opponent has all of its black pixels revealed first.

Example

Here is an example turn.  Player A is trying to reveal Player B's image.  Player B's publicly revealed and hidden encoded images currently look like this:


Player A calls "4, 2" which means she wants to reveal the cell at row 4, column 2.  Player B looks at her hidden encoded image and sees that the cell at "4, 2" contains a 1, so the cell needs to be coloured black:

Because a black cell was revealed, Player A gets to call an extra row and column.  Though not required, she decides to call "4, 2" again to see if she can reveal a run of blacks following the first one.  Player B sees that there are three more cells that contain 1 before the colour changes, so Player B colours in all three cells:


Player A's turn is now finished.

Monday, June 1, 2015

Early Designs for Classroom Games Teaching Computer Science Principles

We have been working on designs for three classroom games as part of our Gram's House story project.  Each game teaches a different computer science principle, and has three different forms: an abstract game, a game with a fictional context, and a game with a complete story.  We will eventually be comparing engagement and learning outcomes between the different versions, but for now we are focused on getting the game mechanics right.  What follows is a summary of the three games so far and some of the design issues we have been running into.

Algorithms

The first game is about writing and performing algorithms. Our learning objective is that players should be able to both create and understand an algorithm of clear and concise directions to solve a simple problem.


First Iteration: Before the game begins, clue bags and decoys are hidden in the space the game will take place in (around a classroom, in a hallway, and so on). The bags will be placed inside of and underneath existing objects to require more complex instructions to find them. Two teams compete in a relay race. One player writes precise, step-by-step instructions to lay out three objects in a clue bag in precise positions on the floor. The next player follows the instructions. Another player writes instructions to find a location on a map inside the clue bag. A fourth player follows the instructions. A fifth player writes instructions to assemble individual parts in a clue bag into a completed object. A final players follows these instructions. Finally, players race to the finish line with their completed objects.

Design Issues: Because the teams are working on the same problems, they must be separated into two different locations. A proctor is required to determine whether algorithm performers have followed the steps correctly and whether the steps have lead to the correct outcome. Because teams are not in the same room, the facilitating instructor cannot proctor effectively, resulting in a player having to do it. Players are only active when they are reading or writing algorithms in their leg of the race, resulting in excess downtime.

Second Iteration: We are working on a cooperative version of the relay race that will reduce player downtime significantly. The race will be done with two teams in two rounds. For each team, two players will work together to write instructions, one player will be the algorithm reader, and the last player will be the algorithm performer. At the beginning of a round, writers will work together to plan their algorithms within a time limit. The non-writers on the first team will begin reading and performing their algorithm. After watching the first team for a short period of time, players on the second team will begin reading and performing their instructions. Writers will continue to refine their instructions after they are fully performed until the performers successfully complete the task.

Data Organization

The second game is centred on the principle of data organization. Our learning objective is that players should be able to recognize different ways to organize data, and see how the organization will affect data retrieval. For example, finding information in data that is unorganized requires a linear search, while a binary search can be used when the data is sorted.

First Iteration: Players are required to search a set of cards to find a specific data point. A deck of cards is arranged face down using a different organization each round. Each team draws a target card, and tries to find a card that matches the data on the target. Players can turn over one card at a time, check it, and turn it back down if it is not correct. There is a score penalty for each card checked. In the first round, cards are arranged randomly in a row, forcing players to search linearly or randomly. In the second round, cards are sorted according to the type of data being searched, allowing players to discover binary searching techniques. In the third and final round, cards are grouped into categories based on the data being searched (for example, the groups might be A-D, E-H, and so on).

Design Issues: Although there are points involved, the game feels more like an activity. Students have to observe the sorting order and determine how to make use of it, but there aren't any interesting choices to be made. The first round with randomly ordered cards makes it clear that unorganized data is difficult to search, but is unfair in a game setting; there is a risk of disengaging players.

Second Iteration
: Our most recent idea for this game is unrefined, but holds some promise.  The game involves dividing a communal set of objects with varying properties across multiple dimensions (something like cards, or buttons) into individual piles.  Each player would get a target card that indicates the exact item in the pile she needs to find.  Using one of a hand of action cards, players would modify the piles on the table.  Her goal is to isolate the item she is looking for in a pile with only that item.  This will hopefully lead into a discussion about how to arrange data once so that it is easy to find any data.

Data Representation

Our final game shows players how images can be represented by computers. Our learning objective is that players should understand how images can be represented as numbers using different protocols. We also want players to understand the idea of compression using run-length encoding.



First iteration: Players will work on teams to transmit an image by encoding and decoding it in a relay. Before the game starts, players are asked to decide on a protocol they want to use during the game. In the first round, one team member takes a pixelated image and encodes it row by row by writing numbers according to the chosen protocol. The encoded version is taken to the next team member, who decodes the numbers back into an image within a time limit. The image is checked for accuracy. Players have an opportunity to discuss their protocols before repeating a second round using new images.

Design Issues
: Players spend most of their time doing the rote activity of filling in their images or writing out the numbers. The only interesting choice is in making the protocol to encode images with, but the choice of protocol is constrained by the information already given. While some time is given to improve protocols between rounds, but there is little to no in-game motivation to try something new.

Second iteration: We wanted to maintain a clear connection between numbers and an image, but centre the gameplay on interacting with individual pixels. Our second iteration is for two players and is inspired by Battleship. Each player has an encoded black and white image that she keeps hidden from her opponent, and a publicly displayed grid of unknown pixels where the encoded image will be revealed as a regular image. How many pixels are black in each image is also public. Each player's goal is to reveal the image of the other player. On her turn, a player announces a pixel coordinate. Referring to their hidden encoded images, the other player either reveals the colour of the pixel at that coordinate, or reveal a run of all the pixels of the same colour starting at the coordinate.

---

We are play testing all of our games right now, though some are further along than others.  In a future blog post, I'll share more details about the image representation game, since that is a design I have been working more closely with.

Wednesday, May 27, 2015

Review / JavaScript & jQuery: Interactive Front-End Web Development

Have you ever had a book that was so beautiful, it was hard to put down? Did it happen to be a programming book? Breaking out of what is normally expected of a technical volume, Jon Duckett's JavaScript & jQuery: Interactive Front-End Web Development really is that lovely.  But it's not just a pretty face—it makes a good reference, too.


This book is for anyone interested in front-end web development, whether you have programmed before or not.  The only assumption is that you have a basic knowledge of HTML and CSS.

The book begins with a gentle introduction to basic programming concepts related to JavaScript.  Being an object-oriented language used for event-driven web development, these aspects are touched on early.  I am not convinced that the early treatment of some concepts (like objects and classes) will make sense to beginning programmers, but theoretically the early sections can be revisited and the ideas will make more sense over time.

After covering the basics through branching, looping, and functions, the Document Object Model (DOM) and events are introduced.  There are lots of notes about how you probably won't end up using the specific techniques shown once you know jQuery, but that it's important to understand them as a base.  That's something I really like about this book: you get a good sense of not only what's available, but how real developers work.

The second half of the book covers jQuery, Ajax and JSON, APIs, error handling and debugging, and a few other miscellaneous useful topics.  Though this section has conceptual lessons, much of it feels more like a reference.  There are also many cross-references between pages, which ensures you remember to consider everything relevant when you come back later.

So that's the content.  What about the part about being beautiful?

Every glossy page is laid out like a mini poster.  There is always a visual demo or diagram to support the text, and the text is never in one huge block.  Each page's background is colour-coded to its purpose (for example, explanation vs example) and has a large title in the same location that makes flipping through to find what you're looking for a breeze.  Sometimes I like to sit with the book and just admire how nice each page looks.

Overall, I would recommend this book to anyone who is getting started with front-end development or finds having a physical book as reference useful.  If you already know how to program, you can skim through the first bit.  You may find a closer read useful if you haven't used JavaScript much in the past.  The rest of the book gives a great sense of how front-end works, and can be used as a handy reference when you want to accomplish something specific.  I don't think anyone would be disappointed to have this book on their self.

Tuesday, May 19, 2015

What Eighth Graders Think About Women and Computer Science

On the last day of the 2015 edition of my week-long mini-course (Computer Science and Games: Just for Girls!), I held a discussion about women in computer science.  Below is a transcription of the notes I made on the white board.  The thoughts, if not the wording, very closely represent what the girls said.

"If it is not appropriate for women, it is not appropriate." (via Wikimedia)

Why do girls avoid computer science?
  • Seems nerdy
  • Stereotypes: man's job
  • Don't want to stick out as only female
  • Impression that you must love video games
  • Accused of being interested to attract guys
  • Stereotypes of femininity
  • Females more pressured to take certain programs of study
  • Pressure from others who don't think certain skills are valuable (e.g. video game development)
  • Too many guys, "I will never fit in"
  • Girls are less confident, partly due to society's messages

Why does it matter?
  • Girls can change an idea or product without destroying or outright rejecting it
  • Girls should have the freedom to choose their career without barriers
  • We are turning girls away from their passion
  • Discrimination is always bad
  • Women should have independence, especially financially
  • We need products designed by us
  • Women can change how women are represented in games

What would make you interested in trying computer science in high school or post-secondary?
  • Stop the stereotypes!!
  • Enforce a better gender balance, or provide all-female options
  • People around us have to stop talking down about CS
  • Give us a chance to try it out! We don't know what it is otherwise!
  • More interesting application in university-level courses (like robotics)
  • More positive attitudes toward college-level options [which typically grant diplomas in Canada, as opposed to universities, which grant degrees]
  • Avoid giving the impression that it's impossibly complicated.
  • More one-on-one time (and other better teaching strategies) to make sure we get a good base in math.

Tuesday, May 12, 2015

Mini-Course 2015: Survey Results

Another May, another "Computer Science and Games: Just for Girls!" mini-course on the books.  I'm very pleased with how this year went. The course material and games made by the girls are all online, and below I share the results of my usual pre- and post-surveys.


Pre-Course Survey Results

I have the girls fill these in the very first day before we start into any course material.  Some of them did see the code.org video I showed during orientation, which might affect their answers. 18 students filled in the pre-course surveys.  Here are some of the results.

"What made you decide to take this course?"
  • I thought it might be interesting, trying something new.
  • I like video games and I wanted to find out how to make them.
  • it seemed interesting and I enjoy the idea of creating a virtual game
  • Both my parents have jobs involving computers, and I wanted a course that would be hands on.
  • I think It might have been the words "vidio games" In the title, If It was there.
  • The description looked interesting. I was just curious. I anticipated fun activities.
  • I like computers and gameing.
  • My mom chose for me.
  • My dad is a software developper, and I thought it would be interesting.
  • Because I am interested in expanding my knowledge on computer science and how games are made.
  • I wanted to try something different and this course sounded pretty interesting.
  • There was no other good one to choose & my friend chose it.
  • My parents recommended it for me as they have a friend who works with computer science stuff and he has a successful career.
  • It looked interesting and it was just for girls.
  • I decided to take this course because even though i'm not very good with technology, I was always interested in coding and computers. I like to learn new things and it could be good for a job.
  • I like playing video games with my older brother and love the idea of making my own.
  • I thought it would be fun to know a little more about the technology that we use every day.  At school and at home, we use computers a lot so I thought it would be nice to know how to use them more.
  • I'm interested in trying new things and I spend a lot of time on the computer.
"I am confident that I understand what the field of computer science is."
  • Agree: 1
  • Neutral/don't know: 12
  • Disagree: 4
  • Strongly disagree: 1
 "I would consider computer science as a good career for women in general." 
  • Strongly agree: 5
  • Agree: 10
  • Neutral/don't know: 2
  • Disagree: 1
"I would consider computer science as a good career for me."
  • Strongly agree: 1
  • Agree: 7
  • Neutral/don't know: 9
  • Disagree: 1
"I signed up for this course because I was curious about some of the computer science topics (including usability, graphics, or artificial intelligence)."
  •  Strongly agree: 7
  • Agree: 6
  • Neutral/don't know: 4
  • Disagree: 1
"I have previous experience programming."
  •  Strongly agree: 1
  • Agree: 1
  • Neutral/don't know: 3
  • Disagree: 9
  • Strongly disagree: 4


Post-Course Survey Results

Here are some of the results from the survey I gave at the end of the course.  One student injured herself the previous day, so only 17 students filled in this one.

"Would you have signed up for the course if it wasn't just for girls?"
  • Yes: 10
  • No: 7
"Are you glad the course was just for girls?"
  • Yes: 8
  • No: 2
  • I'm happy as long as I'm not the only girl: 7
"I enjoyed learning about what computer science is really all about."
  •  Strongly agree: 9
  • Agree: 8
"It was cool to see how many different areas of study can be connected to computer science."
  • Strongly agree: 4
  • Agree: 11
  • Neutral/don't know: 2
 "I would consider computer science a good career for me."
  •  Strongly agree: 5
  • Agree: 6
  • Neutral/don't know: 6
(What a great improvement over the pre-course responses!)

"I am more likely to try computer science in high school or university after taking this course, or this course has confirmed my desire to do so."
  • Strongly agree: 8
  • Agree: 6
  • Neutral/don't know: 3
(WOW!! :D)

"I liked having a variety of practising computer scientists to help out with the course."
  • Strongly agree: 8
  • Agree: 9


Summary

I'm very pleased with these results.  You can check out data from previous years (see list at the bottom of this page), but I think this year's course has had the most positive outcomes.  It could be this particular group of girls, the changes I made to the course (like being in the lab all day and cutting more lecturing), or maybe, just maybe, we are finally starting to see the attitudes of the next generation changing.  Let's hope it's the last one, because it's about time we crack this "women in CS" problem once and for all.