Example #1
0
        /// <summary>
        /// This method evaluates the word size format required
        /// by the user and returns a list of sets that adhere
        /// to the requirements.
        /// </summary>
        /// <param name="rawFormat">String letters that define a word size format</param>
        /// <returns>List of sets that adhere to the word size format</returns>
        private ListResultSet FindSets(string rawFormat)
        {
            ListResultSet resultSets = new ListResultSet();

            int[] wordSizes = Array.ConvertAll <string, int>(rawFormat.Split(','), int.Parse);
            foreach (int wordSize in wordSizes)
            {
                resultSets.AddNew(myDictionary.getWordsWithSize(wordSize));
            }
            return(resultSets);
        }
Example #2
0
        /// <summary>
        /// This method evaluates the user's innput and checks it for patterns against
        /// specific dictionary words from a list of word sets.
        /// </summary>
        /// <param name="param">String letters and placeholders of pattern</param>
        /// <param name="wordSet">List of word sets to check</param>
        /// <returns>List of modified word sets with the correct pattern</returns>
        private ListResultSet GetPatternListSet(string param, ListResultSet wordSet)
        {
            ListResultSet simplifiedSet  = new ListResultSet();
            int           indexStartSize = 0;

            for (int k = 0; k < wordSet.allWordResultSets.Count; k++)
            {
                WordResultSet wrs    = wordSet.allWordResultSets[k];
                WordResultSet newSet = GetPatternedWordSet(param, wordSet,
                                                           ref indexStartSize, k, wrs);
                simplifiedSet.AddNew(newSet);
            }

            return(simplifiedSet);
        }