Error with simple button code

Trying to make a button that will rotate between three programs for lights. Here's the code:

Buttonlights

// constants won't change. They're used here to 
// set pin numbers:
const int buttonPin = 3;     // the number of the pushbutton pin
const int ledPinr1 =  13;      // the number of the LED pin
const int ledPinr2 = 12;
const int ledPinr3 = 11;
const int ledPing1 = 10;
const int ledPing2 = 9;
const int ledPing3 = 8;
const int ledPinb1 = 7;
const int ledPinb2 = 6;
const int ledPinb3 = 5;


// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status
int counter = 0
void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPinr1, OUTPUT);  
  pinMode(ledPinr2, OUTPUT);  
  pinMode(ledPinr3, OUTPUT);
  pinMode(ledPing1, OUTPUT);  
  pinMode(ledPing2, OUTPUT);  
  pinMode(ledPing3, OUTPUT);
  pinMode(ledPinb1, OUTPUT);  
  pinMode(ledPinb2, OUTPUT);  
  pinMode(ledPinb3, OUTPUT);  
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);     
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    counter+1;
    // turn LED on:    
   if(counter == 1){
    digitalWrite(ledPinb1, HIGH);
    digitalWrite(ledPinb2, HIGH);
    digitalWrite(ledPinb3, HIGH);  
  } 
  else if(counter == 2){
    // turn LED off:
   digitalWrite(ledPing1, HIGH);
    digitalWrite(ledPing2, HIGH);
    digitalWrite(ledPing3, HIGH); 
  } 
    
  else if(counter == 3){
    digitalWrite(ledPinr1, HIGH);
    digitalWrite(ledPinr2, HIGH);
    digitalWrite(ledPinr3, HIGH);  
  }
  else if(counter == 4)
  counter = 0;
  }
}

Error: Expected unqualified id before numeric constant.

I know some think my code is a bit odd, but it works for me, and has for the last couple decades. Check the curly brackets in your code.

void loop()
{
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH)
  {     
    counter+1;
    // turn LED on:    
   if(counter == 1){
    digitalWrite(ledPinb1, HIGH);
    digitalWrite(ledPinb2, HIGH);
    digitalWrite(ledPinb3, HIGH);  
  } 
  else if(counter == 2)
  {
    // turn LED off:
   digitalWrite(ledPing1, HIGH);
    digitalWrite(ledPing2, HIGH);
    digitalWrite(ledPing3, HIGH); 
  } 
  else if(counter == 3)
  {
    digitalWrite(ledPinr1, HIGH);
    digitalWrite(ledPinr2, HIGH);
    digitalWrite(ledPinr3, HIGH);  
  }
  else if(counter == 4) counter = 0;
  // This is an extra bracket
  }
}

BTW, you should change one of those comparisons. You are always setting the pins to HIGH. One should be LOW, don't you think?

I mean, it's an if statement so it's only going to pick one of those groups to turn on...actually yeah you're right. Yeah. Well i fixed the first error but now I have another about error: expected constructor, destructor, or type conversion before 'const'. Whatever that means. It highlights the first line.

The first line is this:

Buttonlights

What does that do?

counter+1;

Why?

How else can i tell the counter to add 1 if the button is pushed? I changed it so now it says counter++, that's the example from this website.

Also button lights should have been commented out, that may have been the problem. Haha.

AWOL meant you should use one of these two:

counter++;
// or
counter = counter + 1;
int counter = 0

You forget something? Like, oh, I don't know, maybe a ;.