O'Reilly logo

Raspberry Pi For Dummies by Mike Cook, Sean McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customizing the Game

You can customize this game and make many different variations. We made a version that substituted the names of the colors for different cat sounds, in keeping with the name of the game. We got the sound of a domestic cat along with several big cats like lions and tigers. This made it harder to play because players didn’t get the reinforcement of hearing the sounds named.

However, if you want to really blow the minds of your players, change the line

colours = [“red”, “green”, “yellow”, “blue” ]

to

colours = [“blue”, “red”, “green”, “yellow” ]

This means that the game says the wrong color. The player has to ignore the sound and go off the color of the LED alone. This makes the game very hard.

You can also remove the line where the fail variable is set back to zero on a successful guess. That way, the player can only make a total number of failed guesses in any one round and not on any one guess.

The random number generator can throw up the same numbers several times in a sequence. Although this is truly random, it sometimes feels like it’s not. You can change the bit of the program that generated the sequence to choose another number if it’s the same as the previous number. This tends to reduce the length of the sequence the player can remember.

One other variation you might like to try is to have another set of sounds with the announcement of the color preceded by a cat meow. These are the ones used in the correct sequence. However, keep the original sounds ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required