title: If (condition1 && condition2 && condition3 && condition4 == condition1) ? Objective-C
body: <p>I'm making a card game for the iPad (Panic, Nervous Breakdown,Stress). To win you need to have a full set of 4 matching cards, I'm trying to get an IF statement that will work to make sure that all of the 4 cards are equal. Here is my current code:</p>
  
  <pre><code>if ([cards objectAtIndex:4] &amp;&amp; [cards objectAtIndex:5] &amp;&amp; [cards objectAtIndex:6] &amp;&amp; [cards objectAtIndex:7] == [cards objectAtIndex:5]) {
          //Deck one is good!
          NSLog(@"P1D1, all clear");
  }
  </code></pre>
  
  <p>Cards is a NSMuatableArray. If I have a 2x2 array with the data 4:3:2:1</p>
  
  <p>I would only need to matching cards in slot 4 and 2 for the above statement to return true.</p>