Arduino colour matching game programming questions

Hello! Please pardon any glaring errors made in the code that was overlooked, this is a school project and we are mere amateurs. We are making a colour matching game. This project uses 1 RGB LED and 4 buttons. Players press a start button to start the LED lighting sequence, then wait for the LED to stop at a certain colour. They them have to press a button corresponding to that button. There is also a buzzer.

The game 1. Player presses start button 2. Light and sound sequence commences 3. Random ledcolour generated,LED lights up in that colour 4.If the correct button is pressed,light and sound sequence commences. If the wrong button is pressed, another light and sound sequence commences.

We have encountered problems with coding. This is the code

//buttons
const int matchredPin= 13; //red button
const int matchgreenPin= 12; //greeen button
const int matchbluePin= 7; //blue button
const int matchyellowPin= 4; //yellow button
const int startPin= 2; //start button
//buzzer
const int pinSpeaker= 6; 
//RGB
int redPin= 11; 
int greenPin= 10;
int bluePin= 9;
//random ledcolour
int ledcolor = 0;

int currentState=LOW;

void setColor(int red, int green, int blue)
{
        analogWrite(redPin, red);
        analogWrite(greenPin, green);
        analogWrite(bluePin, blue); }
void setup()
{       
        pinMode(matchredPin, INPUT);
        pinMode(matchgreenPin, INPUT);
        pinMode(matchbluePin, INPUT);
        pinMode(startPin, INPUT);
        pinMode(matchyellowPin, INPUT);
        pinMode(redPin, OUTPUT);
        pinMode(greenPin, OUTPUT);
        pinMode(bluePin, OUTPUT); }
        

void loop()
int ledcolor = random(4); //this randomly selects a number between 0 and 3
{  //Start button 
currentState=digitalRead(startPin);//read input level from pin 2 into currentState

if(currentState == HIGH)   //when the switch is pressed, the voltage is pulled HIGH,
                     
{      //opening colour sequence
       setColor(255, 0, 0); //red
       delay(1000);
       setColor(0, 0, 0); //no colour
       delay(700);
       setColor(0, 255, 0); //green
       delay(1000);
       setColor(0, 0, 0); //no colour
       delay(700);
       setColor(0, 0, 255); //blue
       delay(1000);
       setColor(0, 0, 0); //no colour
       delay(700);
       setColor(255, 255, 0); //yellow
       delay(1000);
       //opening buzzer sequence
       tone(pinSpeaker, 450, 1000);
       delay(700);
       tone(pinSpeaker, 300, 1000);
       delay(700);
       tone(pinSpeaker, 450, 1000);
       delay(700);
       tone(pinSpeaker, 300, 1000);
       delay(700);
       
       switch (ledcolor) {
case 0: //if ledcolor equals 0 then the led will turn red
setColor(255, 0, 0); //red
break;

case 1: //if ledcolor equals 1 then the led will turn green
setColor(0, 255, 0); //green
break;

case 2: //if ledcolor equals 2 then the led will turn blue
setColor(0, 0, 255); //blue
break;

case 3: //if ledcolor equals 3 then the led will turn yellow
setColor(255, 255, 0); //yellow
break; }
       
else
{
       setColor(0, 0, 0);}
       tone(pinSpeaker, 0, 0);
}

currentState = digitalRead(redPin); 
if (currentState = HIGH &&  ledColor == 0)
{
  //same as opening colour sequence
  setColor(255, 0, 0); //red
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(0, 255, 0); //green
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(0, 0, 255); //blue
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(255, 255, 0); //yellow
  delay(1000);
  //buzzer 
  tone(pinSpeaker, 450, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 300, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 450, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 300, 500);
  tone(pinSpeaker, 0, 700);//no sound 
}
else
{
  setColor(0, 0, 0);}
  tone(pinSpeaker, 0, 0);
}
//Wrong- when red button is pressed when LED is green/blue/yellow:
if (currentState = HIGH && ledcolor == 1) //when it is green
if else (currentState = HIGH && ledcolor == 2) //when it is blue
if else (currentState = HIGH && ledcolor == 3) //when it is yellow
{ //led
  setColor(255, 0, 0); //lights up red
  delay(500);
  setColor(0, 0, 0); //no light
  delay(250);
  setColor(255, 0, 0); //lights up red
  delay(500);
  setColor(0, 0, 0); //no light
  delay(250);
  setColor(255, 0, 0); //lights up red
  delay(500);
  setColor(0, 0, 0); //no light
  delay(250);
  //buzzer
  tone(pinSpeaker, 550, 2250); //BUZZZzzzzz...
}
else
{
  setColor(0, 0, 0);}
  tone(pinSpeaker, 0, 0);
}

//green button
currentState = digitalRead(greenPin); 
if (currentState = HIGH && ledcolor == 1)
{
  //same as opening colour sequence
  setColor(255, 0, 0); //red
  delay(1000);
  setColor(0, 0, 0); //no colour 
  delay(700);
  setColor(0, 255, 0); //green
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(0, 0, 255); //blue
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(255, 255, 0); //yellow
  delay(1000);
  //buzzer 
  tone(pinSpeaker, 450, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 300, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 450, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 300, 500);
  tone(pinSpeaker, 0, 700);//no sound 
}
else
{
  setColor(0, 0, 0);}
  tone(pinSpeaker, 0, 0);
}
//Wrong- when green button is pressed when LED is red/blue/yellow
if (currentState = HIGH && ledcolor == 0) //when it is red
if else (currentState = HIGH && ledcolor == 2) //when it is blue
if else (currentState = HIGH && ledcolor == 3) //when it is yellow
{ //led
  setColor(0, 255, 0); //lights up green 
  delay(500);
  setColor(0, 0, 0); //no light
  delay(250);
  setColor(0, 255, 0); //lights up green 
  delay(500);
  setColor(0, 0, 0); //no light
  delay(250);
  setColor(0, 255, 0); //lights up green 
  delay(500);
  setColor(0, 0, 0); //no light
  delay(250);
  //buzzer
  tone(pinSpeaker, 550, 2250); //BUZZZzzzzz...
}
else
{
  setColor(0, 0, 0);}
  tone(pinSpeaker, 0, 0);
}

//blue button
currentState = digitalRead(bluePin); 
if (currentState = HIGH && ledcolor == 2)
{
  //same as opening colour sequence
  setColor(255, 0, 0); //red
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(0, 255, 0); //green
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(0, 0, 255); //blue
  delay(1000);
  setColor(0, 0, 0); //no colour
  delay(700);
  setColor(255, 255, 0); //yellow
  delay(1000);
  //buzzer 
  tone(pinSpeaker, 450, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 300, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 450, 500);
  tone(pinSpeaker, 0, 700); //no sound 
  tone(pinSpeaker, 300, 500);
  tone(pinSpeaker, 0, 700);//no sound 
}
else
{
  setColor(0, 0, 0);}
  tone(pinSpeaker, 0, 0);
}
//Wrong- when blue button is pressed when LED is green/red/yellow:
if (currentState = HIGH && ledcolor == 1) //when it is green
if else (currentState = HIGH && ledcolor == 0) //when it is red
if else (currentState = HIGH && ledcolor == 3) //when it is yellow
{ //led
  setColor(0, 0, 255); //lights up blue
  delay(500);
  setColor(0, 0, 0); //no light
  delay(500);
  setColor(0, 0, 255); //lights up blue
  delay(500);
  setColor(0, 0, 0); //no light
  delay(500);
  setColor(0, 0, 255); //lights up blue
  delay(500);
  setColor(0, 0, 0); //no light
  //buzzer
  tone(pinSpeaker, 550, 2250); //BUZZZzzzzz...
}
else
{
  setColor(0, 0, 0);}
  tone(pinSpeaker, 0, 0);
}

Here are some urgent questions we have: 1. To determine the random led colour we used a switch case. Is this incorrect? If so, is there any other code we can use instead? It would be extremely kind of you to provide examples. :) 2. At the start of the code for each button, we wrote currentState = the pin. Is this incorrect? 3. Error messages that need to be resloved:

 error: expected initializer before 'int'
         error: expected unqualified-id before '{' token
          Error compiling.

We do know that this resembles a bunch of code plucked from various other projects, modified and thrown together into a huge mess, because it is. However, any help is greatly appreciated. If you spot any mistakes, please inform us.

void loop()
int ledcolor = random(4); //this randomly selects a number between 0 and 3

You forgot something - here, { have one of mine.

if (currentState = HIGH &&  ledColor == 0)

Oops

Thanks @ AWOL.