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:
If the user has lost due to a time-out (he didn't hit a button in time), we light up all the LEDs
If the user has lost due to hitting a wrong button in the sequence, we light up the LED that was incorrectly pressed
We then play an error tone
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: