static int GetMatchIndex(Organism org, int[] terrain) { int diff = 0; var data = org.GetMatchData(terrain); for (int i = 0; i < data.Length; i++) { diff += Math.Abs(maxHeight - data[i]); } return(diff); }