Sample TP0 Proposal
This is a sample TP0 submission for a hypothetical student project. It shows the level of detail expected; your proposal will describe your own project. The course staff expects this project would receive a term project grade of about 80%, assuming all proposals are submitted on time and all interviews receive a score of 1.
Section 1: Project overview
What it is. A single-player match-3 puzzle game. The player swaps adjacent gems on an 8×8 board to line up 3 or more of a color. Matches clear, gems fall, and new gems drop in, sometimes causing chain reactions.
What the finished project will include. A title screen, an animated main board, a move limit and target score, a results screen, and automatic reshuffling. Later: hints and special gems.
Section 2: By next week: A playable board
Part A: What these features do
1. Overview
By TP1: a playable Main Board with no fancy animation. The player selects and swaps gems; matches clear, gems “fall” (but just disappear), new gems fill in (by just appearing), and cascades repeat. Score updates. Changes are instant. No move limit or other screens yet.
2. Screens and modes
Main Board (the only screen)
- Canvas 600×700. 8×8 board of 70×70 cells (560×560), 20 px margins. Gems are circles, radius 28.
- Score at top left.
- Click a gem: select it (4 px white outline). Click again to deselect.
- Click an adjacent gem (up/down/left/right): swap. Match → clear. No match → swap back. Selection clears either way.
- Click a non-adjacent gem: selection moves to it.
- Click outside the board: nothing.
- R: new board, score 0.
3. Rules and behavior
- 6 colors: red, orange, yellow, green, blue, purple.
- A new board never starts with a match.
- Only gems sharing an edge can swap. No diagonals.
- A swap must create a match, or it’s undone.
- A match is a horizontal or vertical run of 3+ of one color.
- All matches clear at once. Gems above fall; new random gems fill the top. Repeat until no matches remain.
- Scoring: 3 → 30, 4 → 60, 5+ → 100. No cascade bonus yet.
4. Edge cases
| Situation | Result |
|---|---|
| Swap makes matches for both gems | Both clear and score. |
| L or T shape | Shared gem clears once. Scoring is an open question. |
| Run of 6–8 | 100 points. |
| Two runs in one row | Both found and scored. |
| No valid move left | Nothing yet; player presses R. Reshuffle comes at MVP. |
5. Design decisions
- Undo non-matching swaps (vs. allowing any swap): each move should be deliberate. Free swaps would make a move limit meaningless.
- No animation yet (vs. animating from the start): get the logic right and tested first, so any bug is clearly a logic bug.
6. Out of scope this week
- MVP: animations, move limit, target score, cascade bonus, Title and Results screens, reshuffling
- After MVP: hints, special gems
Part B: Core algorithms
The board is a 2D list of color letters (R O Y G B P); None is an empty cell. Cells are (row, col), with (0, 0) at top left.
Algorithm 1: Generating a board with no matches
1. The problem. Fill a random board with no runs of 3+.
2. Data. In: rows, cols (8, 8). Out: a 2D list of letters.
3. Steps. For each cell, top to bottom, left to right:
- Allowed = all 6 colors.
- If the 2 cells to the left are the same color, remove it.
- If the 2 cells above are the same color, remove it.
- Pick a random allowed color.
4. Worked example.
Row 0: R B Y
Row 1: G B R
Row 2: ? ? ?
(2,0): above are G, R. All allowed. Pick P.(2,1): above are B, B. Remove B. Pick P.(2,2): left are P, P. Remove P. Allowed: R, O, Y, G, B.
5. Edge cases.
- At most 2 colors are removed, so allowed is never empty.
- Row 0 and column 0 lack 2 neighbors above or left. Skip those checks.
6. Open questions.
- This doesn’t guarantee a valid move exists. Handle it with reshuffling at MVP?
Algorithm 2: Finding and clearing matches
1. The problem. After a swap, clear all runs of 3+, drop gems, refill, and repeat until none remain, scoring each run. Also decides whether a swap is valid.
2. Data. In: the board. Out: updated board, points. toClear is a set of cells; runs is a list of run lengths.
3. Steps.
Find matches:
- Scan each row left to right, tracking the run’s color and length. When a run ends (new color or end of row) with length ≥ 3, add its cells to
toClearand its length toruns. - Do the same for each column.
Handle a swap:
- Swap. Find matches. If none, swap back and stop.
- Until there are no matches: score
runs; settoClearcells toNone; move each column’s gems down, keeping order; fill the top with random colors; find matches again.
4. Worked example (one column, top to bottom).
[R, B, G, G, G] → G run at rows 2–4, +30 → clear: [R, B, None, None, None] → fall: [None, None, None, R, B] → refill, say [Y, B, B, R, B] → no run of 3 → done (if no row matches either).
5. Edge cases.
- L or T shape: the set clears the shared cell once.
- Two runs in a row (
R R R G B B B P): the run resets on each color change. - Run ending at the row’s last cell: check for it after the loop ends.
6. Open questions.
- Score an L-shape as two runs (60) or one 5-run (100)?
- Should the fall step record how far each gem fell, for animation later?
Part C: Hand-drawn sketches
Main Board

Algorithm 2
