Blog Post

Choose Your Own Computer Science Adventure!

Spring is in full swing, but it wasn't long ago that winter seemed to have no end in sight. During those cold gray days, I was looking to mix up the programming assignments in my high school Introduction to Computer Science course. In incorporating conditional control structures into our Python programs, I wanted to delve deeper into the idea of branching.


Image Source:

When trying to explain the concept, I started describing for my students how the Choose Your Own Adventure books worked. They were among my favorite books as a child. I loved that you could make choices within the story and read the same book over and over, each time enjoying a different experience. I also loved trying to map out every possible path through the story. The idea of branching becomes much more concrete when considering these stories. Why not program our own in class?

For my high school students, I gave them a simple prompt: Brainstorm a compelling idea for a Choose Your Own Adventure-style story. First, consider the setting, characters, and plot. Create at least three branches in your story paths. The program player should be able to enter a key or word to make a choice between two options at each of your three branches. The outcomes should differ based on each choice the player makes. Your whole story should be nested inside a while loop, allowing the player to answer (y/n) at the end of each game if they wish to play again. If they enter “y”, they can play again. If they enter “n”, the game terminates with a descriptive message.

This could be a great project to connect computer science with a social studies, English, or a science topic, or you can let students select their own themes. Even if you are not learning a programming language such as Python, crafting a story outline on paper makes for an interesting unplugged activity for students of all ages. If this choice is selected, then what happens? This could also be done in a word processing document such as Google Docs with simple hyperlinks and bookmarks within a document.

Here are some resources you can use to create Choose Your Own Adventure-style stories with your computer science students:

Have you tried something like this in your class? What other ways do you have to integrate computer science with other topics?