How can I program loop?

i am making a tic tac toe game. I have two sets of 9 leds. one set for player one and another for player 2. I have 4 pushbuttons 2 for each player. when i push 1 of the buttons i want the first led to light up then when i press it again the second led would light up ant the first would stop then if i would press the second button then it would keep the second led on and then i could choose another led while the first led i chose is still on. this is my code so far but ineed help on my loop any help is appreciated also in my code pbcp1 means pushbutton cursor player 1 and pbsp1 means pushbutton select player1. if it ends in 2 instead of one then it is just for player 2. Thanks in advance.
Code:

int pbcp1 = 13;
int pbsp1 = 12;
int pbcp2 = 11;
int pbsp2 = 10;
int greenled1 = 22;
int greenled2 = 24;
int greenled3 = 26;
int greenled4 = 28;
int greenled5 = 30;
int greenled6 = 32;
int greenled7 = 34;
int greenled8 = 36;
int greenled9 = 38;
int redled1 = 23;
int redled2 = 25;
int redled3 = 27;
int redled4 = 29;
int redled5 = 31;
int redled6 = 33;
int redled7 = 35;
int redled8 = 37;
int redled9 = 39;

void setup() {
pinMode(greenled1, OUTPUT);
pinMode(greenled2, OUTPUT);
pinMode(greenled3, OUTPUT);
pinMode(greenled4, OUTPUT);
pinMode(greenled5, OUTPUT);
pinMode(greenled6, OUTPUT);
pinMode(greenled7, OUTPUT);
pinMode(greenled8, OUTPUT);
pinMode(greenled9, OUTPUT);
pinMode(redled1, OUTPUT);
pinMode(redled2, OUTPUT);
pinMode(redled3, OUTPUT);
pinMode(redled4, OUTPUT);
pinMode(redled5, OUTPUT);
pinMode(redled6, OUTPUT);
pinMode(redled7, OUTPUT);
pinMode(redled8, OUTPUT);
pinMode(redled9, OUTPUT);
pinMode(pbcp1, INPUT);
pinMode(pbsp1, INPUT);
pinMode(pbsp2, INPUT);
pinMode(pbcp2, INPUT);
}

void loop() {

}

I think that the first thing that you should do is to learn about and use arrays. For example, this code

const byte greenLeds[] = {22, 24, 26, 28, 30, 32, 34, 36, 38};
const byte redLeds[] = {23, 25, 27, 29, 31, 33, 35, 37, 39};

void setup()
{
  for (int pin = 0; pin < 9; pin++)
  {
    pinMode(greenLeds[pin], OUTPUT);
    pinMode(redLeds[pin + 1], OUTPUT);
  }
}

void loop()
{
}

sets up all the LED pins as outputs. Notice how much neater and smaller the code is than yours. The structure will pay dividends later, trust me.

As you can see from the code in my setup() function you can refer to the LED pins by the array name and iarray index number which makes turning them on in sequence much easier, which I think is what you want to do.

So, to turn on the third red LED for example you do
digitalWrite(redLeds[2], HIGH);Note how the array index starts at 0 not 1, so the third LED is index number 2.

Wouldn't a 3×3 array make more sense?

Maybe to you and me, but maybe not to the OP as this is probably his/her first exposure to arrays.