Arduino is skipping through lines of code - not a coding issue

Hi, when I run my program through tinkercad it works just fine. When I run it through my arduino, however, it skips a whole block of code (the for() loop that blinks the yellow LED). I’ve tried multiple Arduinos with the same result. Any suggestions?

int yellowPin = 13;
int redPin = 12;
int redBlinkNumber;
int yellowBlinkNumber;

void setup() {

  Serial.begin (9600); 
pinMode (redPin, OUTPUT); 
pinMode (yellowPin, OUTPUT);

  Serial.println ("How many times do you want the red LED to blink?"); while (Serial.available () == 0) {} redBlinkNumber = Serial.parseInt(); delay (2000);

  Serial.println ("How many times do you want the yellow LED to blink?"); while (Serial.available () == 0) { } yellowBlinkNumber = Serial.parseInt(); delay (2000);
}

void loop() {
  Serial.println("The Red Light is Blinking!");

  for (int x = 1; x <= redBlinkNumber; x++) {

    Serial.print ("This is blink #: ");
    Serial.println(x);

    digitalWrite (redPin, HIGH);
    delay (1000);
    digitalWrite (redPin, LOW);
    delay (100);
  }
  Serial.println("The Yellow Light is Blinking!"); delay (1000);

  for (int y = 1; y <= yellowBlinkNumber; y++) {

    Serial.print ("This is blink #: ");
    Serial.println(y);

    digitalWrite (yellowPin, HIGH);
    delay (1000);
    digitalWrite (yellowPin, LOW);
    delay (100);
  }
}

Add some debug prints and find out that the number of times that you blink the yellow LED is in fact zero?

when I run my program through tinkercad it works just fine

Real-world trumps simulation, every time.

I don’t understand…If you have a real Arduino, then why would you run on tinkercad? By the way you gotta organize your code. It’s all over the place. Use Ctrl + t to Auto Format…

As this is your first post, it’s better if you learn how to use the forum