I want to use an array to control output values. What can I do?

Make an array of pin numbers, and use a for loop to iterate over the array.