Back

Bonus Project: Simon Says

Difficulty  

Optional — Extra Credit

divider

What This Is

The board plays a sequence of lights and tones. You repeat it back on the buttons. Every round it adds one more step, and it gets away from you faster than you expect.

This is the hardest of the bonus projects and the one most worth doing. Everything it needs you already have — a list that grows, buttons that get read, LEDs and a speaker. Nothing new, just more of it at once.

divider

What You'll Need

  • Four LEDs, each with its own resistor
  • Four buttons, each from 3V3 to its own pin with Pin.PULL_DOWN
  • The speaker, through its 330Ω resistor

Four buttons is exactly what the kit contains. Give each LED a different tone — that is what makes the sequence memorable rather than just visible.

divider

Build It

  1. Wire four of each and prove all eight parts work before writing any game logic. A dead button discovered mid-game is very hard to spot.
  2. Play one step. Pick a random light, flash it with its tone, then wait for a press. Right button or wrong?
  3. Grow a list. Keep the sequence in a list and append() a new random step each round.
  4. Play the whole sequence back each round, from the start, before the player's turn.
  5. Check the player's presses in order. One wrong press ends the game.
  6. Report the score — how many rounds they survived.

The trick in task 5 is comparing two things that arrive at different times: the sequence is already in a list, and the presses come in one at a time. Compare each press against the sequence position it should match, and stop at the first mismatch.

divider

What Success Looks Like

Round 1 — watch...  your turn  OK
Round 2 — watch...  your turn  OK
Round 3 — watch...  your turn  wrong!

You made it to round 3.
divider

Then Make It Yours

  • Speed the playback up as the sequence grows
  • Let the player choose a difficulty at the start
  • Show the round number on the OLED
  • Play a distinct losing sound rather than just stopping

Commence Project