function definition is not allowed before '{' token

Help! this is the error i keep getting, and i dont know why :frowning:
also, how do use the code box post thing>?

long randNumber;
//Random number ebtween 1-11 guessing game
byte incomingByte;
void setup()
{
Serial.begin(9600);
//Starting Rules
Serial.println("Hello! Welcome to the Guessing Game!");
delay (1000);
Serial.println("RULES");
delay (1500);
Serial.println(" The Arduino will think of a number between 1 and 10");
delay (1500);
Serial.println(" Once it has done that, it will ask you to input the number within 10 seconds");
delay (1500);
Serial.println(" If you are correct, a win message will pop up");
delay (1500);
Serial.println(" If not, a Try Again message will appear");
delay (1500);
Serial.println(" Good Luck!");
delay (2000);
Serial.println(" You'll need it ....");
//End Rules
randomSeed(analogRead(0));
//Generates random seed

randNumber = random(10, 20);

// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
}

if (incomingByte == 'randNumber');
{ Serial.println("Yes, right Number!");
}

void loop(){
}

It means exactly what it says, match all your curly brackets in the setup function. If one is missing, you will be trying to add a 'function definition' (void loop() ) inside another function ( void setup() ).

also, how do use the code box post thing>?

All explained here: How to use this forum

   if (incomingByte == 'randNumber');

C doesn't work like this.

Also: http://www.gammon.com.au/forum/?id=12153#trap13