Help needed to convert some code.

Yes, if you want you can have a single array of button pin numbers.

Have a look at the tutorials and examples.