My code isn't working

I'm making a roulette on my lcd and I can't seem to lock certain functions. here is my code. I want to make it so that when I press select, I can no longer use the left right up down buttons.

long randNumber;

int x;
int y;
int z;
int a;
int b;
int c;

int chips;
#include <LiquidCrystal.h>




LiquidCrystal lcd(8, 9, 4, 5, 6, 7);        
void setup() {
  lcd.begin(16, 2);
  y = 100;
  b = 1;
  a = 1;
  c = 1;
  x = 1;
}


void loop() {
if (c=1){
  int z = analogRead (0);

  if (z < 60 ){ //right
    lcd.setCursor (0, 1);
  lcd.print("black");
  delay (200);
}
else if (z < 200) {

}
else if (z < 400 )
{
  x = x + 1; //up
  delay (200);
}
else if (z < 600 ) {

  x = x - 1; //down
  delay (200);
}
else if (z < 800 ) {

  c= 2;
  lcd.setCursor (0, 1);
  lcd.print ("red  ");  //Left
  delay (200);
}
else { // select
  chips = 2;

}}


if (x < 1) {
  x = y;
}
else if (x > y) {
  x = 1;
}
else if (x < 10) {
  lcd.setCursor(1, 0);
  lcd.print("      ");
}
else if  (x < 100) {
  lcd.setCursor(2, 0);
  lcd.print("      ");
}
else if (x < 1000) {
  lcd.setCursor(3, 0);
  lcd.print("      ");
}




lcd.setCursor(12, 0);
lcd.print (y);
lcd.setCursor (0, 0);
lcd.print (x);


delay (0);

}

Welcome to the forum

You started a topic in the Uncategorised category of the forum when its description explicitly tells you not to

Your topic has been moved to a relevant category. Please be careful in future when deciding where to start new topics

What do you mean by this ?

if (c=1)

That statement will set c to 1 not compare it with 1

use = to set a variable to a value
use == to compare a variable to a value

delay (0);

Why ?

It would be helpful if you formatted the code so that it was properly indented. I also found that the spurious blank lines made it a little harder to follow.
Before I could follow your code I copied it into the IDE then did select all and tools -> auto format. Then I removed the spurious blank lines.
By the time I spotted the two things: = used in if statement, and delay(0), which I was going to comment on, the above post had already been made.

yeah my bad i didn't know how to format it

yeah it's benn 4 hours since I started so I didn't know this.
Thank you.

What about

I'm trying to make it so that when I press select, I can't go left right up or down

Thanks a lot, I'm doing this for a class project.

If I were you I would start by fixing the =/== problem then give the variables meaningful names. As it is I have no idea what you mean by select, up, down, left or right

It looks like you are using an LCD shield with 5 built in buttons on a Uno board but that is a guess

Your variables have no meaningful names.
This makes it very hard for other users what variable does what.

You should unload the work of this time-consuming work from the shoulders of your potential helpers. And last but not least giving each and every name in your code a meaningful name will make it easier for yourself to maintain your code

Yeah that's what I'm doing. Sorry for forgetting to say it

ok will try. Thank you. Sorry if my code is absurd

If z is 100 then z is smaller than 200 and 400 and 600 and 800 and then what.

Every if condition will be true.

This does nothing.

else if (z < 200) {

}

It's else if, so it will apply the conditions in order, not at the same time.
Correct me if I'm wrong

What must the value for z be to make this above line true.

I made this code to verify which button was associated to which value, and the < didn't apply to anything
I removed it.

Post your updated code where you corrected all the errors reported by.
@UKHeliBob
@Dave_Lowther
@StefanL38

I'm making changes right now, but I'm going to post it in a few minutes

long randNumber;

int bet;
int money;
int z;
int a;
int b;
int set;

int chips;
#include <LiquidCrystal.h>




LiquidCrystal lcd(8, 9, 4, 5, 6, 7);        // déclare les prises utilisées par le shield

void setup() {
  lcd.begin(16, 2);
  money = 100;
  b = 1;
  a = 1;
  set = 1;
  bet = 1;
}


void loop() {
  if (set == 1) {
    int z = analogRead (0);

    if (z < 60 ) { //right
      if (set == 2)
      lcd.setCursor (0, 1);
      lcd.print("black");
      delay (200);
    }
    
    else if (z < 400 )
    {if (set == 2)
      bet = bet + 1; //up
      delay (200);
    }
    else if (z < 600 ) {
          if (set == 2)
      bet = bet - 1; //down
      delay (200);
    }
    else if (z < 800 ) {

      if (set == 2);
      lcd.setCursor (0, 1);
      lcd.print ("red  ");  //Left
      delay (200);
    }
    else { // select
      set = 2;

    }
  }


  if (bet < 1) {
    bet = money;
  }
  else if (bet > money) {
    bet = 1;
  }
  else if (bet < 10) {
    lcd.setCursor(1, 0);
    lcd.print("      ");
  }
  else if  (bet < 100) {
    lcd.setCursor(2, 0);
    lcd.print("      ");
  }
  else if (bet < 1000) {
    lcd.setCursor(3, 0);
    lcd.print("      ");
  }




  lcd.setCursor(12, 0);
  lcd.print (money);
  lcd.setCursor (0, 0);
  lcd.print (bet);




}