Disliked----------------------------------------------------------------
if (StartingArray[pos] > StartingArray[pos+1]) // flip to > if you want smallest to largest
----------------------------------------------------------------
That code above may be the problem, because you haven't specified what action to take if this statement is not true.
I would put a in a print line, some code with a loop to print each variable in the array before and after each operation, to verify what you expect. Just a thought.
Regards,
David.Ignored
Each of the pairs is receiving a rank, but for some reason, some pairs are getting the same rank which doesn't make sense to me.
Inserted Code
for(int j = 0; j<14; j++) { for(int k = 0; k <14; k++){ if(StartingName[j] == ReferenceName[k] && j < 7) RankArray[k] = j - 7; if(StartingName[j] == ReferenceName[k] && j >= 7) RankArray[k] = j - 6; } }
I would expect the above block of code to be the culprit. Except I don't know how.