Boost Your Memory with the Simon Game in JavaScript

The Simon Game is an engaging exercise that challenges your memory and increases in difficulty as you play. Discover how this fun game, built with just 134 lines of code in JavaScript, can benefit your mind and how you can play it online.


The Simon Game is an intermediate level exercise in JavaScript that tests memory. It is a memory game that increases in difficulty as you play. On the webpage, four colored squares with different sounds each, appear. The computer randomly chooses a color, you press it, then it selects another, and you press that too, continuing in the same manner. This creates a pattern that you must remember. Every time you correctly select the pattern, you advance to the next level, and a new color is added to the existing ones.


This game is recommended by experts as particularly beneficial for improving memory, especially for older people who need to exercise their minds. An average user can progress up to level 10-15 with a little practice. Someone with a particularly good memory will go beyond level 20. Of course, the final score depends on the randomly created pattern, some of which are very difficult, while others are easier.


In terms of programming, two lists of colors are created: the one generated by the computer and the other selected by the player, and they are compared throughout the game. If they are equal, the game continues; if not, it's Game Over and you start from the beginning. All of this is done in 134 lines of code, which are available here.


You can play the game online by clicking on the photo below. To start the game, press any button.