class Program { static void Main(string[] args) { string[] set1 = { "AA0", "BC1", "XYZ", "000" }; string[] set2 = { "AZ0", "BXY", "HIJ" }; string[] set3 = { "A12", "BHO", "LMN" }; ArrayList al = new ArrayList(); al.Add(set1); al.Add(set2); al.Add(set3); List<List<string>> obj = new List<List<string>>(); for (int i = 0; i < al.Count; i++) { for (int j = 0; j < 3; j++) { List<string> allset = new List<string>(); var a = al.Cast<string[]>().ToList(); allset.AddRange(a[j]); obj.Add(allset); } } //var itm = from d in obj select d[k].ToArray(); //foreach (var item in itm) //{ // Console.WriteLine(item); //} for (int l = 0; l < obj.Count; l++) { for (int k = 0; k < 3; k++) { //Console.WriteLine(obj[k]); } } int loopnumber = 1; ArrayList l2 = new ArrayList(); for (int i = 0; i < obj.Count; i++) { for (int m = 0; m < obj[i].Count; m++) { string str = ""; //condition_1: swap 3rd column of matrix if (loopnumber == 1) { str += obj[i][0].ToString() + obj[i][1] + obj[m][2]; } //condition_1: swap 3rd column of matrix else if (loopnumber == 2) { //if (m == 0) //{ // i = 0; //} str += obj[i][0].ToString() + obj[m][1] + obj[i][2]; } //condition_1: swap 3rd column of matrix else if (loopnumber == 3) { //if (m == 0) //{ i = 0; } str += obj[m][0].ToString() + obj[i][1] + obj[i][2]; } //if (l2.Contains(str) == false) //{ l2.Add(str); //} } //str += set1[i] + set1[i + 1] + set1[i + 2]; //} if (i == 8) { loopnumber++; i = 0; if (loopnumber > 3) { break; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)