The Robot Game at RailsGirls Krakow
I think it is hard to introduce people to programming by having theoretical presentations about code, commands, terminals & servers. That's why during Railsgirls Krakow I organized a game that allows participants to experience, in real life, a lot of programming concepts.
The game
The goal is to drive the 'robot' through a maze, by giving it a sequence of commands, and have it bring back an object. At Railsgirls, some of the coaches played robots, and the objective was to make the robot reach a cupcake placed in the maze.
What I love about this game is that, by playing it, one gets a lot about how programming works.
The robots accepted instructions only when written on a piece of paper, and did not respond to any other interaction - just like machines run programs. We emphasized that the instructions in the program must have a specific structure - one command per line, and that the commands must belong to the set of available commands. Robots would 'error' in funny ways if the program wasn't valid - which will (hopefully) help the players understand why they get syntax errors in real programs as well.
The game also makes you see how the program 'runs', in real life; you follow its progress, and see clearly why it errors (the robot hits a wall, or there is no cupcake to pick). It's also very easy to see if it works correctly or not - you either have a happy robot with a cupcake in hand at the end, or not.
How it worked
To introduce the game, I held a short presentation in which I explained the concept, accompanied by a robot which executed commands, for the attendees to get a glimpse of the available commands and how the robot works. Then we went to playing the game!
Some teams took a very analytical approach, measuring the step length, calculating how many steps were needed and writing the program in one go. Some were a bit intimidated by the task, and we encouraged them to write some small, test programs, and iterate from there.
It was very exciting for me to see them get involved, the empathy with which they watched their program run, some almost imitating the robot, cheering for it, and celebrating each victory - getting the robot to turn at the right location, getting the second turn right, getting the cupcake.
The coaches were great robots, executed the programs as rigorously as a machine would do, but error-ed in funny, creative ways.
After each team wrote a successful program to get the cupcake, we asked them to make it shorter by inventing new commands. They quickly came up with compound commands (step = step right + step left) and repeating instructions (10 x step), turning the ~25 lines of the initial program into less than 10. One team understood that the number of characters must be minimized, so they wrote an algebra-like one-liner like i 10*(x,y) j 7*(x,y) i 4*(x,y) t
.
Notes on organizing the game
The main challenge was the limited available space, as RailsGirls Krakow had 50 attendees, and about 25 coaches & organizers. To optimize the space, I created 3 labyrinths, each one with 2 robots, and 2 teams x 4 girls per robot. Each labyrinth also had a person that answered questions and interfaced between the teams and the robots. So I made sure that there is enough room for 20 people around each game.
For the labyrinth itself, the goal was to have it as small as possible, while having at least two paths to go to the cupcake, and at least one long line on each path (to compel them to invent loop commands). We also needed it to be large enough for the robots to walk relatively confortable. After a couple of tests we settled on this shape, and used masking tape directly on the floor to make it:
Testing also revealed that it is hard for the (human) robots to make even steps, so we instructed them to make small, tip-to-toe steps. They also called out loud each command as they executed it, and kept track of the current command, to show the error line if the program failed.
Thanks
Big thanks to WebMuses for organizing RailsGirls and having me organize the game. Monika Starzyk helped me with ideas, real-life testing, feedback and encouragement. The coaches that volunteered to be robots or to manage labyrinths were awesome. I also thank DrTechnico, whose posts about the game inspired me to do it.