Serial monitor

void loop()
{
 int z;
  int i;
  int k,q,w,e,r;
  if(Serial.available())
  
  {
  
 
    z= Serial.read();
    if(z=1)Serial.print("A");
    else Serial.print("B");
 /*   q= z[0];
    w= z[1];
  
    //check and move pawn
    if((data[q][w])=='P')
    {
      if(data[e][r]='G')
              Serial.println("Piesa in fata--alta mutare");
      else {
        
      data[e][r]=='P';
       for(int x=0;x<8;x++){
       for(int y=0;y<8;y++){
         Serial.print(" ");
           Serial.print(data[x][y]);
         }Serial.println();}
         i=0;k=0;
  
    }
    }
    }

i would like my serial monitor to print A for input 1 and rest B
the problem is that i get only A and AA
the plan is to get z as 3 digits and make an algorithm for a chess with a 8/8 matrix
do i read the value wrong ?

I hate codes and puzzles.

if(z=1)Serial.print("A");oops

yep
got it
danke
i'm stupid