coding help?

Does anybody code with an arduino? I can’t figure out the problems with my code and I would like someone to look over my code to see if it would to what I intend for it do to.

What it’s supposed to do: generate a number and use 8 leds on a breadboard to signify if the guess is too high, low or spot on, and respond accordingly.

What’s wrong with my code: “serial doesn’t have a type”, also, idk how my leds are going to react. are they gonna all blink at once with a 100ms delay, or are they gonna blink once at a time in order?
If you can help me, that’d be great.

Serial.begin(9600) {
pinMode(2, OUTPUT), pinMode(3, OUTPUT), pinMode(4, OUTPUT) , pinMode(5, OUTPUT) , pinMode(6, OUTPUT) , pinMode(7, OUTPUT) , pinMode(8, OUTPUT) , pinMode(9, OUTPUT);
}

void loop() {
Serial.println(“Guess a number between 0-255”);
number = Serial.Readline;
randNumber = random(255);
while (Serial.available() == 0);
number = Serial.parseInt();

while (number < 255({
//if (money)<255// the computer will generate a random number
Serial.println(“guess the number”)
};
while (Serial.available() == 0);
answer = Serial.read();

if (guess > Num) {
(
answer == ‘n’);
printIn(“Guess is too low, try again.”);
digitalWrite(2, 3, 4, 5, 6, 7, 8, 9)LOW);
delay(100);
}

if (guess < Num) {
answer == ‘n’)
printIn(“Guess is too high, try again.”);
digitalWrite(9, 8, 7, 6, 5, 4, 3, 2, 1) HIGH);
delay(100);

}
else {
yes
number = number = Number
println (“you won! cue John Cena theme song”);
digitalWrite(2, 3, 4, 5, 6, 7, 8, 9 HIGH);

}
}

You are pulling our leg.

Why don't you hook it up and see if it works?

Oh I see, it doesn't have a snowballs chance at compiling. Maybe you should work through a few tutorials or examples and see if you can figure out the syntax it expects instead of making stuff up.

Ok, lets start with the first issue.

 Serial.begin(9600) {
  pinMode(2, OUTPUT), pinMode(3, OUTPUT), pinMode(4, OUTPUT) , pinMode(5, OUTPUT) , pinMode(6, OUTPUT) , pinMode(7, OUTPUT) , pinMode(8, OUTPUT) , pinMode(9, OUTPUT);
}

You probably mean

void setup() {
 Serial.begin(9600);
  pinMode(2, OUTPUT), pinMode(3, OUTPUT), pinMode(4, OUTPUT) , pinMode(5, OUTPUT) , pinMode(6, OUTPUT) , pinMode(7, OUTPUT) , pinMode(8, OUTPUT) , pinMode(9, OUTPUT);
}

That line that sets the pin modes will work, but for all the wrong reasons.

It looks like someone tried really hard to make every possible mistake in the book in one code. If that was your intention then bravo. That's impressive.

Oh, I swear all of my errors in java,python and arduino have all been me failing to change something or add a semicolon or something. thanks.

Your Serial.begin(9600) is missing terminating semicolon. And your variables are probably interpreted by compiler as Serial.begin method code. But that is immaterial, after you add the semicolon after Serial.begin(xxx) the compiler will be happier and you probably get more errors traceable to simple syntax problems.

Serial.begin(9600)         HERE  

This probably belongs to setup , but still has a syntax error 

C commands are terminated by semicolon 

so

oinMode(2,OUTPUT); semicolon 
....

{
  pinMode(2, OUTPUT), pinMode(3, OUTPUT), pinMode(4, OUTPUT) , pinMode(5, OUTPUT) , pinMode(6, OUTPUT) , pinMode(7, OUTPUT) , pinMode(8, OUTPUT) , pinMode(9, OUTPUT);
}

Asiancorruption: Oh, I swear all of my errors in java,python and arduino have all been me failing to change something or add a semicolon or something. thanks.

You will be surprised by many "something" after your code compiles.

It would help YOU to add comments / description to EACH line of code and READ it out loud to yourself or explain it to your significant other.

You MAY see the logic flaws better.

But it has to compile first, no matter how many "somethings" are "missing" / wrong !

There's a LOT more wrong here than a semicolon.

digitalWrite(2, 3, 4, 5, 6, 7, 8, 9)LOW);

Have you ever seen any Arduino code? If not you should look at some.

Ever seen anyone else do it like that? Wonder why?