I need help with a little code entry pad.

What i have so far, am stuck though,

// Project Awesome. Code Entry With Four Buttons
int y = 0; // Set y
int x = 0; // Set x
int ledOne = 13; //Set Red LED
int ledTwo = 12; //Set Green LED
byte buttons[] = {2,3,4,5,6,7,8,9,10}; //Set buttons to array
byte pass[] = {2}; // Set password
byte attempt[1]; // Set attempts array
byte state[9]; // Make states array
byte oldstate[9]; // When button is hit, info added here
int time = 0;

void setup(){
  pinMode(ledOne, OUTPUT);
  pinMode(ledTwo, OUTPUT);
  for(x=0; x<9; x++){
    pinMode(buttons[x], INPUT);
  }
}


void loop(){
  for(x=0; x<9; x++){
    state[x] = digitalRead(buttons[x]); // Check states of each button
  }
  for(x=0; x<9; x++){
    if(state //...
  }
  for(x=0; x<1; x++){
    if(attempt[0] == pass[0]){
      Correct();
    }
  }
  if(attempt[0] != pass[0] && (millis() - time) > 5000){
    TimeOut();
  }
  for(x=0; x<9; x++){
    oldstate[x] = state[x];
  }
}

void Correct(){
  digitalWrite(ledOne, LOW);
  digitalWrite(ledTwo, HIGH);
}

void TimeOut(){
  digitalWrite(ledTwo, LOW);
  digitalWrite(ledOne, HIGH);
}