blinking LED's in series, trying it in c way

And my semi product 12 leds that turn in series one after another from pin 2 to 12 than turn of from 12 to 2 and do that forever...

long long counter = 1000;
int main () {
  int ledPin; //maybe i should have picked only one, tried several versions and this logic worked in my head the most
  int oldVal;
  while(1) {
  for( oldVal=2; oldVal <= 12; oldVal++)  {
    ledPin=oldVal;
    pinMode(ledPin, OUTPUT);
    digitalWrite(ledPin, HIGH);
    
   while(counter < 100000) {     //just a manual delay funct cuz the original one did not work at all
    counter++;
    }
    counter=0; //reset which i added
    }
  
if (ledPin==12){
  
  for( oldVal=12; oldVal >= 2; oldVal--)  {
    ledPin=oldVal;
    pinMode(ledPin, OUTPUT);
    digitalWrite(ledPin, LOW);
    
   while(counter < 100000) {     //just a manual delay funct cuz the original one did not work at all
    counter++;
    }
    counter=0; //reset which i added
    }
} 

else  {
  
  }
  }
  return 0;
  }