In this project, students build a matching game in order to gain experience and proficiency with loops, control flow, two-dimensional arrays, writing functions from their specifications and making simple graphical interfaces. In addition, students will learn how to manipulate game state to represent a game board, use randomness to vary the game state, change game state in response to user clicks, and draw a graphical representation of that game state.
The project itself is heavily scaffolded, but assumes prior experience with a graphics library, loops, and conditionals. The scaffolding is appropriate for students not able to independently divide a large program into parts, or need the project divided into checkpoints. The assignment includes a program template with function specifications, and in-template notes providing students with basic program structure. The assignment includes two demonstrable, intermediate checkpoints and a grading rubric.
The most re-usable parts of this assignment:
- The concept of a matching game for an engaging way for students to practice 2D arrays and functions.
- That http://game-icons.net/ provides professional-looking CC-BY-SA icons for the game.
- The provided grading rubric may be a useful guide for this type of assignment, even if it is heavily adapted.
- This is not a good first exposure to any Python graphics library. It is recommended that students have drawn squares and lines and interacted with mouse clicks in some prior lab or assignment.
- Adapt the assignment to whatever graphics library your students have already used in class: it only needs to support drawing squares, showing images and interpreting click-interactions.
- Encourage student choice: let students select their own game colors and icons from http://game-icons.net/ to customize their games.
- You could adapt the assignment to teams or pair-programing.
This project's goal is to build a relatively simple matching game, in the style of the game Concentration. So it may be both meaningful and relevant for some students. The ability to customize the game with alternative game icons and themes adds an element of student-choice.
Materials and Links
Computer Science Details