How to can I make multiple LEDs circuit stop with a button? (noob here)

I have this multiple LED circuit, in which the program lights up each LED in sequence and then loops (simple). Now i’d like to add the button to interrupt the circuit, but get the LED (which was lit up when pressing the button) to stay on. Sort of like the arcade game “cyclone”.

Here is some code if you are a bit confused on how I did this:

void setup() {
  for (int Pin = 3; Pin < 8; Pin++) {
    pinMode(Pin, OUTPUT);
  }
}

void loop() {
  
  for (int Pin = 3; Pin < 8; Pin++) {
    digitalWrite(Pin, HIGH);
    delay(100);
    digitalWrite(Pin, LOW);
  }

  for (int Pin = 7; Pin >= 3; Pin--) {
    digitalWrite(Pin, HIGH);
    delay(100);
    digitalWrite(Pin, LOW);
  }

}

I also attached a picture of how my wiring is…
Thanks in advance!

Simply read the button in that loop and if it is pushed then hold until it is released. Use a while loop to keep reading the button and only finish when it is released.

 while( digitalRead (inputPin) == LOW) ;

Note wire up the push button between input and ground and enable the internal pull up resistors.

sorry, should the button be in the circuit as the LED is?

alexholstv:
sorry, should the button be in the circuit as the LED is?

Well yes if you want it to work with the sketch.

The switch arrangement suggested by @Grumpy_Mike would be wired as S3 in the pictured example. Note, the switches can be connected to any digital input (avoid using D0 & D1).