The program that you have just seen is fine for displaying a sequence of values, but our game needs to store that sequence. The best way to store a sequence of values is in an array. We can then work our way through the array to display the sequence. We can also pre-set the contents of the array in the program itself. This means that the first version of the game will always use the same sequence of lights.
Later in the course we will see how a to create a random number which can be used instead.
On the right you can see an array of unsigned char values. An unsigned char variable holds values in the range 0-255, which is just what we need to control the LEDs.
Note that I have not given the size of the the array. The C compiler is able to count the number of values being supplied to set up the array and will make an array of the correct size, in this case 5 elements.
/* creates an array with a 5 */
/* element pattern in it */
unsigned char pattern [] =
{ 1, 2, 32, 1, 128 };