SIMON 7
In this project, we finish the development of our Simon-like pattern matching game by adding a final win/lose sequence.
Speaker & Audio Cable
I/O (Input/Output) RaspberrySTEM Cell
Having issues? Check out the Troubleshooting Guide.

In this project, we're going to add in our final sequence when the user makes a mistake and we drop through the while loop. 

When this happens, we want to do the following: 

  1. If the user has lost due to a time-out (he didn't hit a button in time), we light up all the LEDs 

  2. If the user has lost due to hitting a wrong button in the sequence, we light up the LED that was incorrectly pressed 

  3. We then play an error tone 

  4. Finally, we play the correct sequence one last time (quickly)

Here is what that code will look like:


Here is what the final code for this project looks like -- go have some fun playing and feel free to add more features to customize the game how you'd like:



home | prev | next