Is there anything wrong with my code?

Hello, I'm new to arduino and I need this code, I can't try it out since I don't have the items from this, they are at the scholl. All the ? markers is simply because I dont have that information before tomorrow.

This code should calibrate it's own max and min distance after that an DC motor (AnalogDC) should go backwards or forwards depending on the readed distance.
Also KDC Should run forward only.
Last thing, ignore the // parts, those are in danish and are only nodes to me.

// Disse er konstante
const int AnalogIn = ?;
const int AnalogDC = ?;
const int KDC = ?;
const int threshhold = ?;// Distancen skal findes
const int Led = ?;
// ? skal skiftes ud med den pin som de sidder på.

// Variere sammen med kalibreringen i ved opstart.
int sensorValue =0;
int sensorMin = 1023;
int sensorMax = 0;

void setup (){
pinMode (AnalogDC, OUTPUT);
pinMode (AnalogIn, INPUT) ;
pinMode (KDC, OUTPUT) ;
// Får en LED til at tænde i kalibrerings perioden.
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);

// 5000 giver 5 sekunder til kalibreringen.
while (millis()<5000) {
sensorValue = analogRead (AnalogIn);

// Definere max
if (sensorValue > sensorMax) {
sensorMax = sensorValue;
}

// Definere min
if (sensorValue < sensorMin) {
sensorMin = sensorValue;
}
}

// Får LED'en til at slå fra og vise at kalibreringen er overstået
digitalWrite(13, LOW);
}

void loop() {
//Læser distancen
int analogValue = analogRead (AnalogIn);

// Hvis kritereiet mødes køre moteren fremad
if (analogValue > threshold {
digitalWrite(AnalogDC, HIGH);
digitalWrite(KDC, HIGH);
}
else {
digitalWrite(AnalogDC, REVERSE);
digitalWrite(KDC, HIGH);
}
delay(1) //Tid mellem læsning

What sensor is being read in setup()?
Why is the minimum and maximum data not used in loop()?
Why is loop() missing a close }?

    digitalWrite(AnalogDC, REVERSE);

Reverse?

I can't try it out since I don't have the items from this,

You could download the IDE and at least try compiling it.

Yeah I used Reverse for making it go backwards?
Thats what people have told me to use but I guess thats wrong since you say it like that?

It's not wrong, per se (good practise, even), but without telling the compiler what "REVERSE" means, it's a real non-starter.

AnalogIn is going to be a sensor.

Threshold is going to have a number and from that the sensor should decide what to do, threshold is going to be something between max and min sensor value.

The missing } was simply a beginner mistake.

How can I tell it what Reverse is then?

How can I tell it what Reverse is then?

In a similar way to how you told it what "AnalogIn" was.

When I have told it what reverse is, does this look fine, ? makers are replaced with the right numbers ofc ^^

does this look fine,

Does what look fine?
What does the compiler say?

The compiler keeps poiting out the ? markers and the ; right after them, as far as I can see I don't get any other errors, I have tried to set the Reverse function but I'm not sure it is putted in correctly :confused:

You have changed your code but not posted the new version and it is not possible to help you any further until you do.

Sometimes thinking ain't my good side...

But the new code looks like this:
// Disse er konstante
const int AnalogIn = ?;
const int KDC = ?;
const int threshhold = ?;// Distancen skal findes
const int Led = ?;
// ? skal skiftes ud med den pin som de sidder på.

// Variere sammen med kalibreringen i ved opstart.
int sensorValue =0;
int sensorMin = 1023;
int sensorMax = 0;
int AnalogDC = ?;
int AnalogDCR = ?;

void setup (){
pinMode (AnalogDC, OUTPUT);
pinMode (AnalogDCR, OUTPUT);
pinMode (AnalogIn, INPUT) ;
pinMode (KDC, OUTPUT) ;
// Får en LED til at tænde i kalibrerings perioden.
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);

// 5000 giver 5 sekunder til kalibreringen.
while (millis()<5000) {
sensorValue = analogRead (AnalogIn);

// Definere max
if (sensorValue > sensorMax) {
sensorMax = sensorValue;
}

// Definere min
if (sensorValue < sensorMin) {
sensorMin = sensorValue;
}
}

// Får LED'en til at slå fra og vise at kalibreringen er overstået
digitalWrite(13, LOW);
}

void loop() {
//Læser distancen
int analogValue = analogRead (AnalogIn);

// Hvis kritereiet mødes køre moteren fremad
if (analogValue > threshold {
digitalWrite(AnalogDC, HIGH);
digitalWrite(KDC, HIGH);
}
else {
digitalWrite(AnalogDC, LOW);
digitalWrite(AnalogDCR, HIGH);
digitalWrite(KDC, HIGH);
}
}
delay(1) //Tid mellem læsning

  else {
    digitalWrite(AnalogDC, LOW);
    digitalWrite(AnalogDCR, HIGH);
    digitalWrite(KDC, HIGH);
  }
}
  delay(1) //Tid mellem læsning

Why post stuff like this (badly) when the compiler will tell you whether or not it is valid?
What is that last delay doing outside of an braces?