Simple LED cycle code randomly stopping

Sorry if this seems to be a noob question, but it's been a long time since I've done anything with Arduino and I'm steadily relearning everything.

I recently wrote a simple LED cycle code (attached) to cycle through 5 leds one at a time. I've been using and USB battery to power the board. For some reason, the assembly works for a couple minutes and then randomly stops. Unplugging and replugging it resets it. I don't know if it's my for loop getting hung up, some sort of clock problem, or if there's some sort of idle setting. Any suggestions?

// That code thing that Kith wrote

//Variables
int leds[] = {2,3,4,5,6}; // Array of the pins used
int d=100; // Delay time in milliseconds

void setup()
{
for(int i=0; i<5; i++){
pinMode(leds*,OUTPUT);*

  • }*
    }
    void loop()
    {
  • for(int i=0; i<=7; i++){*
    _ digitalWrite(leds*, HIGH);_
    _
    if(i!=0){_
    _
    digitalWrite(leds[(i-1)], LOW);_
    _
    }_
    _
    delay(d);_
    _
    }_
    _
    for(int i=7; i>=0; i--){_
    _ digitalWrite(leds, HIGH);
    if(i!=7){
    digitalWrite(leds[(i+1)], LOW);
    }
    delay(d);
    }
    }
    [/quote]*_

Ranges look a little funny.
You have leds[0] thru leds[4] defined.
You write to leds[5], leds[6] & leds[7] tho.
That usually creates a problem, overwriting something else stored in SRAM.

....Wow I feel dumb, I forgot I put the pins into an array. >n< Thanks