using && not giving result expected

Using a pro mini at 16mHz with two PIR modules.
I am aiming to detect the direction of circular movement of a hand over a round table.
With as little power consumed from batteries as possible.
I have made and tested two 4 hole masks, mounted over the sensors so that the sensed annular ring area is split up into alternating sections.

I have found that the PIR sr501 with BISS0001 chip has a way of eliminating false positives which means I need to sample the analog output on pin12.
I just need to register any change in the sensor output for that particular area on the table.

The output is measured at the arduino A0 and A1 pins as expected from oscilloscope tests.
The sr501 modules still function in their own way as normal.
Which is handy, because one will be used in the final sketch to trigger ‘wake from sleep’.

In spite of commenting out the analogRead() and substituting the resting level equivalent to about 1.65v, the motorCW() and motorCCW() functions are continuously called alternately.

Not sure exactly how the compiler is treating my && statement?

//I have two PIR sensor boards with 4 hole masks rotated offset by half hole spacing.

//Each PIR then has four areas, alternating with the other PIR, where IR from a moving hand can be sensed.
//I take the output from the second stage amp and feed it into the Arduino ADC input.
//Now similar to detecting press order with two buttons.
//Is the movement of the hand CW or CCW?.
//The values need to be polled.
//Array state[] stores flag = 1 if any movement detected.
int state[2];
int val1 = 0;
int val2 = 0;
int noise = 200;

void setup()
{
pinMode (13,OUTPUT);//Led monitor
digitalWrite(13,LOW);
state[1] = 0;
state[2] = 0;
}

void motorCW()
{
  state[1] = 0;
  state[2] = 0;
  for (int counter = 0;counter<5;counter++)
  {digitalWrite(13,HIGH);
  delay(200);
  digitalWrite(13,LOW);
  delay(200);
  }
}

void motorCCW()
{
  state[1] = 0;
  state[2] = 0;
  for (int counter = 0;counter<2;counter++)
  {digitalWrite(13,HIGH);
  delay(500);
  digitalWrite(13,LOW);
  delay(500);
  }
}
void loop()
{
  for (int wait = 0;wait<10000;wait++)
  {
    //val1 = analogRead(A0);
    //val2 = analogRead(A1);
    val1=338;
    val2=338;
    if (val1 > (338 + noise)){state[1] = 1;}
    if (val1 < (338 - noise)){state[1] = 1;}
    if ((state[1] = 1) && (state[2] = 1))
  {motorCW();}
    if (val2 > (338 + noise)){state[2] = 1;}
    if (val2 < (338 - noise)){state[2] = 1;}
    if ((state[2] = 1) && (state[1] = 1))
  {motorCCW();}
    delay(10);
  }
}
if ((state[1] == 1) && (state[2] == 1))

many thanks - that's worked!
you guys are so patient with the babies learning to walk.
On the other hand it must be interesting sometimes to see some crazy projects attempted.