looking for example for button changing program

I'm working with an arduino mega, and have setup a simple led flashing pattern from another example.

My question is the kit included a little push button.
What I would like to do is have multiple flash patterns uploaded to the arduino, and when the push button is pressed, tell it, ok, go from program 1, to program 2, program 3, program 4, etc. each time the button is pressed, then when you have cycled thru all the programs, it starts back at program 1.

Below is the code i'm using to flash 4 led's

int red = 12;
int blu = 11;
int wht1 = 10;
int wht2 = 9;
int redblue_time = 150;
int whtwht_time = 100;
long last_redblue = 0;
long last_whtwht = 0;
long time_now;
bool red_state = HIGH;
bool blue_state = LOW;
bool wht1_state = HIGH;
bool wht2_state = LOW;

// Red & Blue Lights
void setup()
{
  pinMode(blu, OUTPUT);
  pinMode(red, OUTPUT);
  pinMode(wht1, OUTPUT);
  pinMode(wht2, OUTPUT);
}

void loop()
{
  time_now=millis();
  
  if ((time_now - last_redblue) > redblue_time)
  {
    if (red_state == HIGH)
    {
      red_state=LOW;
      blue_state=HIGH;
    }
    else
    {
      red_state=HIGH;
      blue_state=LOW;
    }
    digitalWrite(red,red_state);
    digitalWrite(blu,blue_state);
    last_redblue=time_now;
  }  

  if ((time_now - last_whtwht) > whtwht_time)
  {
    if (wht1_state == HIGH)
    {
      wht1_state=LOW;
      wht2_state=HIGH;
    }
    else
    {
      wht1_state=HIGH;
      wht2_state=LOW;
    }
    digitalWrite(wht1,wht1_state);
    digitalWrite(wht2,wht2_state);
    last_whtwht=time_now;
  }
  
}

So how can i define when it detects button pressed, move on to another program (besides) the program already listed here.

Thanks

From what i know about C you would do it with different functions rather than a different program. I don't think you can have another program as such on the Arduino i could be wrong. Still what you want to do is have a look at how to code functions and maybe even class's as well this is were you will find a solution i think.

maybe my wording was not correct there using program, sorry.

What I mean is have something at the top of the existing code that says
if tactical button is pressed on ?pin?
run function (code already written)
then, if button is pressed again, run another function with a different flash pattern, such as the same code, just different timing.

all included in the same sketch to upload.

It sounds like you need to read about functions (loop and setup are functions) and about parameters and arguments.

Have you gotten this tutorial working yet?

First step .. get the button working. Once you have the button doing something as simple as turning on or off an LED - then you can implement it into your app.