title: Compare elements of the same array
body: <p>I have problem with comparing the value of array elements.
  e.g. I wanted to compare the value of index 0 and index 2, and index 1 to index 3 and so on.
  With the code below I suppose to get the result of numOfdifferentShape is 2 but I get 3.
  How can I solve this problem? :-( </p>
  
  <pre><code>int numOfdifferentShape=0;
  
  myArray = {40.0, 40.0, 40.0, 40.0, 80.0, 40.0, 40.0, 40.0}
  
  for (int a=0; int a&lt;myArray.size(); a=a+2)
  {
     for (int b=a+2; b&lt;myArray.size; b=b+2)
     {
        if (!(myArray.get(a).equals(myArray.get(b) &amp;&amp; myArray.get(a+1).equals(b+1)))
           numOfdifferentShape++;  
        break;
     }
  }
  </code></pre>