SIMON 6

In our last project, added in the use of the buttons as input and we tested the sequence of button presses to determine if they were correct or not.  This was much of the basis for our game, but now it's time to add some additional features.  In this project, we'll add sound to our LED flashes.

Programming Implementation

First, we need to import the sound function we'll use and initialize a list of four sounds -- one for each of the LEDs:

INSERT CODE BLOCK

# Initialize the LEDs and sequence list
from rstem.sound import Note

notes = [Note('A'), Note('B'), Note('C'), Note('D')]


Next, we need to insert our sounds into two locations -- where we flash the sequence of LEDs for the player and where the player presses a button while repeating the sequence.  Here are what those two code blocks should be updated to:


Here is what the code for this project should look like at this point:



prev| next