Randomly Alternate LED pins

I tried using the random function and got errors. I tried:

Please post the complete program that you tried

I would put the pin numbers to be selected at random in an array and use random() to choose the array index and hence a random pin number