# Simon Says Help!

I am trying to figure a way out to make a Simon Says game on the CPX using blocks. I want to divide pixels into 4 sections, one for each of the colors (0-2 = red, 2-4 = blue, 5-7 = yellow, 7-9 = green), but I cannot figure a way to do that.

What I have is a way to add to the pattern and how to show the pattern (maybe).

Adafruit has an example of a code https://learn.adafruit.com/simon-game-clone-with-circuitplayground-express-and-circuitpython/light-design but I figure out how to translate to blocks.

Here is what I have so far:

Thank you in advance for any help!

Ooh! Youâ€™re giving me an excuse to dig out my Circuit Playground Express! Nice! Now, where did I put that thingâ€¦

Stay tuned!

1 Like

So, I used a simpler way to activate the LEDs using `show ring`. Feel free to alter the colors to your liking; I used the colors and locations used in the Adafruit article that you mentioned. Yes, you could do the same thing with a bit of math, but this just feels like it fits better with the Blocks environment.

1 Like

Now, we can handle the touch sensors. I added a variable, `acceptInput`, which is checked before the touch is processed. Right now, `acceptInput` is simply set to `true`. You donâ€™t always want to be accepting input during the game, though, so weâ€™ll need a way to ignore player input later.

Hereâ€™s how I did it:

Because weâ€™ve assigned each color a number, when youâ€™re building Simonâ€™s sequence and accepting player input, you just need to use the numbers 1 through 4 instead of trying to create an array of colors or light patterns.

Iâ€™ll stop here for now so that you can give it a go. Good luck!

1 Like

So I was stuck on trying to have the player input the entire sequence before comparing it with the game sequence. Is there a way to the compare the values of two arrays using blocks? Eventually realized you have to check after every button press.

Here it is:

1 Like

YES! Good work!