photoresistor and servo project

I am relatively unfamiliar with this programming language so I am having difficulty making this project. My goal is to make and program a device that takes light intensity readings from different angles and then goes back to the angle with the highest light intensity. Here is what i have from looking other places:

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position
int highest = 0; // variable to store the highest recorded intensity
int intenseangle = 0;
int oldintensity = 0;
int buzPin = 8;

void setup()
{

Serial.begin(9600); //Begin serial communcation
int servoPin = 10;
pinMode( servoPin, OUTPUT );
myservo.attach(15); // attaches the servo on analog pin 1 to the servo object

}

void loop()
{
int lightPin = 14;
float intensity = 0;

for(pos = 0; pos <= 180; pos += 5) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
Serial.println(analogRead(lightPin)); //Write the value of the photoresistor to the serial monitor.

intensity = analogRead(A0);
oldintensity = intensity;
if (intensity > oldintensity)
{ intenseangle = pos;
highest = intensity;
}

delay(30);
myservo.write(intenseangle);
delay(1000);

tone(buzPin,50,1000);
break;
}

So what is your problem?

I think you need two arrays of the same size (perhaps 10 elements)

One array has 10 angles at which the servo will collect light measurements
The other array contains the measurement for each position.

The code would be something like

for (n = 0; n < 10; n++) {
   myServo.write(servoPos[n];
   delay(100); // time for servo to move
   adcReading[n] = analogRead(ldrPin);
}
brightPos = 0;
for (n = 1; n < 10, n++) {
  if(adcReading[n] > adcReading[brightPos]) {
      brightPos = n;
  }
}
myServo.write(servoPos[brightPos]);

…R