Photo controlled LEDs and buzzer

Hi,
Im trying to make a thingy where a photosensor controls 3 LEDs and a piezo buzzer. It should be so that when it is light there is no music or light, when its dark the lights and music come on.
Im trying this so that I can use some code from the tutorials I have done individually - like combining the three. I have reached the point where I could use a little help please. Im blindly guessing at stuff now. Im sure Id need to set a condition (Boolean?) so that when there is no light the lights and buzzer activate, is that right?
I left the code in for 1 more LED than there actually is, as the last LED wasn't flashing at full brightness with the correct number of LEDs in the c ode. This way it does.
Regards the loop Im having problems putting it together.
Im not electrically minded so have posted a pic of my circuit too. I have about 10hours experience with Arduino as you can see.
Any help appreciated as I keep getting errors when I Verify. Im expecting the worst.
Thanks.

//Pin Variables
int lightPin = 0;
int ledPins[] = {2,3,4,5};
int speakerPin = 9;



void setup()
{
  int lightLevel = analogRead(lightPin); //Read the
  // lightlevel
  lightLevel = map(lightLevel, 0, 900, 0, 255);
  //adjust the value 0 to 900 to
  //span 0 to 255
    pinMode(lightPin, OUTPUT)
    
  //Set each pin connected to an LED to output mode (pulling high (on) or low (off)
  for(int i = 0; i < 3; i++)     //this is a loop and will repeat eight times
    pinMode(ledPins[i], OUTPUT); //we use this to set each LED pin to output
  
  int length = 15; // the number of notes
char notes[] = "ccggaagffeeddc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;

void playTone(int tone, int duration) {
  for (long i = 0; i < duration * 1000L; i += tone * 2) {
    digitalWrite(speakerPin, HIGH);
    delayMicroseconds(tone);
    digitalWrite(speakerPin, LOW);
    delayMicroseconds(tone);
  }
}

void playNote(char note, int duration) {
  char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
  int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };
  
  // play the tone corresponding to the note name
  for (int i = 0; i < 8; i++) {
    if (names[i] == note) {
      playTone(tones[i], duration);
    }
  }
}
 {
  pinMode(speakerPin, OUTPUT);
}



/*
 * loop() - this function will start after setup finishes and then repeat
 * we call a function called oneAfterAnother(). if you would like a different behaviour
 * uncomment (delete the two slashes) one of the other lines
 */
void loop()                     // run over and over again
{
  
     lightLevel = constrain(lightLevel, 0, 1); 1;//make sure the 
  //value is between 
  //0 and 255
  analogWrite(ledPins[2,3,4,5], lightLevel); 1; //write the value
  
    oneOnAtATime();          //this will turn one LED on then turn the next one
  //on turning the 
  //former off (one LED will look like it is scrolling 
  //along the line
}
/*
 * oneOnAtATime() - Will light one LED then the next turning off all the others
 */
void oneOnAtATime(){
  int delayTime = 70; //the time (in milliseconds) to pause between LEDs
  //make smaller for quicker switching and larger for slower

  for(int i = 0; i <= 3; i++){
    int offLED = i - 1;  //Calculate which LED was turned on last time through
    if(i == 0) {         //for i = 1 to 7 this is i minus 1 (i.e. if i = 2 we will
      offLED = 3;        //turn on LED 2 and off LED 1)
    }                    //however if i = 0 we don't want to turn of led -1 (doesn't exist)
    //instead we turn off LED 7, (looping around)
    digitalWrite(ledPins[i], HIGH);     //turn on LED #i
    digitalWrite(ledPins[offLED], LOW); //turn off the LED we turned on last time
    delay(delayTime);
    
    for (int i = 0; i < length; i++) {
    if (notes[i] == ' ') {
      delay(beats[i] * tempo); // rest
    } else {
      playNote(notes[i], beats[i] * tempo);
    }
    
    // pause between notes
    delay(tempo / 2);     
  }
}
[code]

[/code]

Does your code REALLY look like that crap? DO NOT USE THE COPY FOR FORUM OPTION!

Since that code is way too hard to read, I'm going to have to pass on helping, until you post the code correctly.

OK is that better?

OK is that better?

The presentation is much better. The code now can be seen to have some major problems.

    pinMode(lightPin, OUTPUT)

Missing a ; at the end.
Useless, since analog pins are output by definition.
Useless, too, because this is attempting to diddle with digital pin 0, which is the hardware serial pin.

void playTone(int tone, int duration) {

You can NOT define a function inside a function. setup() is a function.

     lightLevel = constrain(lightLevel, 0, 1); 1;//make sure the 
  //value is between 
  //0 and 255

That is NOT what that code does. lightLevel is local to setup() and can not be referenced in loop(). That code needs to be moved from setup() to loop().

  analogWrite(ledPins[2,3,4,5], lightLevel); 1; //write the value

You are NOT allowed to invent your own syntax. You can NOT write to multiple pins at once this way.
The second statement on that line is useless.

Ill try and figure it out some more, thanks for the pointers. Im aware its a complete mess.