private string[] GetLines20(string[] c) { int[,] stringer = Worder.Stringer20(); int[,] positioner = Worder.Positioner20(); int size = stringer.GetLength(0); int innerSize = stringer.Length / size; string[] result = new string[size]; for (int i = 0; i < size; i++) { result[i] = ""; for (int j = 0; j < innerSize; j++) { result[i] = result[i] + c[stringer[i, j]].Substring(positioner[i, j], 1); } result[i] = result[i] + result[i]; } return(result); }
private List <Worder> StringFinder(string[] c, int pk) { int[,] stringer; int[,] positioner; string[,] directioner; if (pk == 15) { stringer = Worder.Stringer15(); positioner = Worder.Positioner15(); directioner = Worder.Directioner15(); } else if (pk == 5) { stringer = Worder.Stringer5(); positioner = Worder.Positioner5(); directioner = Worder.Directioner5(); } else { stringer = Worder.Stringer20(); positioner = Worder.Positioner20(); directioner = Worder.Directioner20(); } string[] internalWords = { "ANCHOVY", "BACON", "CHEESE", "GARLIC", "GREENPEPPER", "HABANERO", "JALAPENO", "MUSHROOMS", "OLIVE", "ONION", "PINEAPPLE", "PEPPERONI", "SAUSAGE" }; string[] externalWords = { "SALAMI", "AVOCADO", "PEANUTBUTTER" }; string[] externalWordsC = { "TUNA" }; string[] externalWordsB = { "SALAMI", "AVOCADO", "SODA", "SEGMINA", "PEANUTBUTTER", "TUNA", "BONE", "CHOKE", "BHEL", "SEAL", "TUBE" }; bool[] internalFlag = new bool[internalWords.Length]; bool[] externalFlag = new bool[externalWords.Length]; List <Worder> internalList = new List <Worder>(); List <Worder> externalList = new List <Worder>(); for (int i = 0; i < c.Length; i++) { string currComparator = c[i]; string result = new string(currComparator.ToCharArray()); for (int j = 0; j < internalWords.Length; j++) { string currWord = internalWords[j]; int match = currComparator.IndexOf(currWord); if (match != -1) { while (result.IndexOf(currWord) != -1) { result = result.Replace(currWord, ""); } internalList.Add(new Worder(currWord, positioner[i, match], stringer[i, match], directioner[i, match])); } } for (int j = 0; j < externalWords.Length; j++) { string currWord = externalWords[j]; int match = currComparator.IndexOf(currWord); if (match != -1) { while (result.IndexOf(currWord) != -1) { result = result.Replace(currWord, ""); } externalList.Add(new Worder(currWord, positioner[i, match], stringer[i, match], directioner[i, match])); } } Print(result); } internalList.AddRange(externalList); return(internalList); }