示例#1
0
        static void Main(string[] args)
        {
            // \n is a newline
            // \t is a tab space
            const string HelpMessage = "###Wordscapes Cheater###\n\n" +
                                       "Returns matching words based on the characters you provide.\n\n" +
                                       "wsc characters\n\n  characters  The characters that Wordscapes gives you.\n\n" +
                                       "Example:\nwsc cat\nact\ncat";

            if (ArgsNeedsHelp(args))
            {
                Console.WriteLine(HelpMessage);
                return;
            }

            //We can use the other args for other stuff later
            //e.g. word count or letter position
            string        characterSet = args[0];
            List <string> dictionary   = CheatFunctions.GetDictionary();

            PrintMatchingWords(CheatFunctions.BuildMatchingWordsArray(characterSet, dictionary));
        }
示例#2
0
 public void BuildMatchingWordsArray_ValidString_Succeed(string input, string stringResult)
 {
     string[] expectedResult = stringResult.Split(';').ToArray();
     string[] arrayResult    = CheatFunctions.BuildMatchingWordsArray(input, CheatFunctions.GetDictionary());
     CollectionAssert.AreEquivalent(arrayResult, expectedResult);
 }