Ejemplo n.º 1
0
        static bool Prompt(string message, bool ignoreCase, params string[] acceptedInput)
        {
            Console.Write(message);
            string ans = Console.ReadLine();

            if (ignoreCase)
            {
                ans = ans.ToLower();
            }
            for (int i = 0; i < acceptedInput.Length; i++)
            {
                if (acceptedInput[i].Equals(ans))
                {
                    return(true);
                }
            }

            return(false);
        }