Problem with Simon Game

Hello everyone, since I took a certification here on FreeCodeCamp regarding Javascript, I wanted to do a challenge (also from FreeCodeCamp) which is to create a Simon game, but without anyone’s help, in the sense that I created the game interface myself. The problem I’m having is that when I click start, I get the warning that the pc is giving me the colour scheme, but there are neither the colours nor the sound mp3s playing. I leave here the link to my Codepen. Any help is welcome

hey i don’t know whats wrong but it might be some thing with what ever ai junk that you have because for me that wouldn’t load.

Hello there,

You have a few syntax errors:

<h1 class="heading js-heading;" style="text-align: center;">Simon Game</h1>
<div class="scores";

Also, what element has this property?

const circle2 = document.querySelector(`[data-circle2='${color}']`);
1 Like

I would suggest switching the Syntax Highlighting on Codepen. It will help catch syntax errors.

Go to your Codepen profile settings. Under “Editor Preferences” switch the Syntax Highlighting to Oceanic Dark and save the setting. Go back to the pen and make sure your new setting is working, the code highlighting will be using different colors. If there are issues you should see code marked in red. That is the new Syntax Highlighting showing you where the problems are.

Press the down arrow to the right of the code boxes and select the “Analyze” option. You can also use a validator tool.


Edit: Also, code with the console open Ctrl + Shift + J or at least remember to check it when things aren’t working.

1 Like

Perfect, now my Simon works. Thanks for the tip. I don’t know if I should open another topic, but in my SImon I would like to put an on/off button so that my machine turns on and off by pressing that button, but I don’t know how to do it as other users have written it in JQuery and I still don’t know it as a language. I don’t know, I always take advice, but what I do get is an on/off button that does the switch but doesn’t turn on and off.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.