Simon game | Strict mode and reset game doesn't work

Hey there,

I have been trying to figure out how to solve a bug/problem that arises when I’m trying to activate strict mode. Also there is a problem with resetting the game as it doesn’t do that.
I have been banging my head against the keyboard trying to solve this issue for the last few days to no avail.
Any help would be greatly appreciated.
Here is the link for the codepen code: Simon Game


Actually, your game does not even work in non-strict mode. I turn the game on and click RE/Start and it lights up and plays a tone for the first round. I click on the correct button and the console shows “wrong” and the game keeps lighting up the same button and playing the same sound, no matter how many times I click the correct button.

You should thoroughly test out your game to see all the issues it may have right now. I did not have time to review all 248 lines of the JavaScript to figure out why the above happens. When you narrow down where you think the problem is and still have questions, reply back to this same thread with a very specific question about code you think you work one way but instead does something different and we will try to help point you in the right direction.

At this point, you need to figure out the basic play mode first.

Another issue I noticed is that the button lights up first and then plays the sound instead of both happening simultaneously.

Thanks mate for your time. I appreciate it a lot.

I revisited my code and made some changes and now I think I have the basic functionality.

The only thing I need to figure out is how to disable mouse pointer during the computer sequence display and re-enable it after.


I reviewed your game again, but it does not appear to be working any more than it did when I reviewed it 10 hours ago. I stay in the first round no matter how many times I click the correct button that first lights up and plays a sound. When I click on the correct button of the first round, it should thing repeat that same button and light up/play sound for another random button (it could be the same button as the first). Your game is not doing that.

Yep. You are right. If you are testing it on Chrome. I only tried it in Firefox. My bad. Maybe setTimeout() and setInterval() are implemented differently in these 2 browsers. I’ll try to sort it out.

I think I made it work. Thanks mate for pointing out the above issues.