예제 #1
0
        public string ProvideWord()
        {
            while (true)
            {
                var word = Console.ReadLine();
                if (string.IsNullOrEmpty(word) || word.Length != 4)
                {
                    _logger.WriteConsole("");
                    _logger.WriteConsole($" !!! Please provide 4 letter word !!! ");
                    _logger.WriteConsole("");
                    _logger.WriteConsole($"== Provide another word ==");
                    continue;
                }
                else if (!_dictionary.CheckIfWordExsits(word))
                {
                    _logger.WriteConsole("");
                    _logger.WriteConsole($" !!! Word : {word} does not exist in supplied dictionary !!! ");
                    _logger.WriteConsole("");
                    _logger.WriteConsole($"== Provide another word ==");
                    continue;
                }

                return(word);
            }
        }