Please help some basic switch code not working?

You need to read the pins specified by the values in the array "buttons" instead of comparing the values in the array itself.
See reply #1.

if(digitalRead (buttons[y])==LOW) {

I can't guarantee it will work, but it will be closer to working than it is at the moment.