I need help with a little code entry pad.

if the oldstate array isnt made until the end of the loop, how am i meant to compare the the state with oldstate before its even made

The array is "made" when you declare it as a global variable. Is it populated with a bunch of default values, appropriate to the type of the array. Arrays of type int, byte, long, etc. are initialized to 0 (which corresponds to LOW).

You may need a little more work in loop(). Right now, you are setting the value in attempt[0] to the pin number that changed state. This sounds good, until you consider that releasing the switch also generates a state change. So, pressing a switch will affect attempt[0] and releasing the switch will affect attempt[0]. Is this what you want? Or, do you just want to know when switch i has been pressed?