Exemple #1
0
        static void Main(string[] args)
        {
            string word = String.Empty;
            while (String.IsNullOrEmpty(word))
            {
                Console.Out.Write("Enter a word, any word: ");
                string input = Console.In.ReadLine();
                if (Regex.IsMatch(input, "([a-z]|[A-Z])+"))
                    word = input;
                else
                    Console.Out.WriteLine("Word must contain only letters A-Z");
            }

            WordGuesser guesser = new WordGuesser(1000, 10000, 0.2, 0.6);
            guesser.Guess(word);

            Console.In.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            string word = String.Empty;

            while (String.IsNullOrEmpty(word))
            {
                Console.Out.Write("Enter a word, any word: ");
                string input = Console.In.ReadLine();
                if (Regex.IsMatch(input, "([a-z]|[A-Z])+"))
                {
                    word = input;
                }
                else
                {
                    Console.Out.WriteLine("Word must contain only letters A-Z");
                }
            }

            WordGuesser guesser = new WordGuesser(1000, 10000, 0.2, 0.6);

            guesser.Guess(word);

            Console.In.ReadLine();
        }