Simon Says Problem

Hello, we have a problem with the understanding of this programm for a Simon Says game.
Especially the function of current and previousMillis.

Thank you
Eva

//Returns the position of Button pressed (0, 1, 2, or 3) or -1 if no button is pressed in the time period.
int waitForButton(int delay)
{
int buttonPressed = -1;
int input; // Taster gedrückt
boolean buttonBackUp = false;

currentMillis = millis(); // The number of ms since the program started running
previousMillis = currentMillis; // Records the point when we start spinning the loop.

// Keep spinning the loop until “delay” seconds have passed.
while (currentMillis - previousMillis < delay & tasterWiederOben == false)
{
// Read the button and record when it has been pushed down.
for (int pin = 0; pin < 4 & tasterWiederOben == false; pin++)
{
if (digitalRead(taster[pin]) == HIGH)
{
buttonPressed = pin;

// Show the LED pushed.
digitalWrite(leds[pin], HIGH);

// It is possible the button is still being pushed.
// This loop spins until the button is let up.
while (currentMillis - previousMillis < delay & tasterWiederOben == false)
{
input = digitalRead(taster[pin]);
if (input == LOW)
{
buttonBackUp = true;
}
currentMillis = millis();
}

// Turn the LED pushed off.
digitalWrite(leds[pin], LOW);

// See if they took to long.
if (currentMillis - previousMillis > delay)
{
buttonPressed = -1; // They took to long to let the button up so they lose.
}
}
}

currentMillis = millis();
}

return buttonPressed;
}

You didn’t say what the problem is.

Please remember to use code tags when posting code

Posting your complete sketch is a good idea too

       while (currentMillis - previousMillis < delay & tasterWiederOben == false)

Did you mean to use & (bitwise and) in the lines like this or did you perhaps mean to use && (logical and) ?