My approach would be to push simon picked colours to an array and when the player presses a combination you can compare the pressed colour with the top colour of the array. If it matches then pop the top of the array then continue and if not then you failed. If the array is empty or by tracking with a global variable for number of colours then go onto the next game.
The initial colours for picking don't need to be in an array you can use choose("red","green","blue","yellow") which picks a random one of the 4 but then my approach would be to push the colour chosen at this point into the array for comparison.