Пример #1
0
        public static void Main(string[] args)
        {
            JokeManager   manager = new JokeManager();
            UserInterface ui      = new UserInterface(manager);

            ui.Start();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            UserInterface ui    = new UserInterface();
            List <String> jokes = new List <string>();

            ui.Start();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            JokeManager   jokeList = new JokeManager();
            UserInterface ui       = new UserInterface(jokeList);

            ui.Start();
        }
Пример #4
0
        public static void Main(string[] args)
        {
            // List<string> jokes = new List<string>();
            JokeManager   joker = new JokeManager();
            UserInterface ui    = new UserInterface(joker);

            ui.Start();
        }
        public static void Main(string[] args)
        {
            JokeManager manager = new JokeManager();

            /*manager.AddJoke("What is red and smells of blue paint? - Red paint.");
             * manager.AddJoke("What is blue and smells of red paint? - Blue paint.");
             *
             * Console.WriteLine("Drawing jokes:");
             * for (int i = 0; i < 5; i++)
             * {
             * Console.WriteLine(manager.DrawJoke());
             * }
             *
             * Console.WriteLine("");
             * Console.WriteLine("Printing jokes:");
             * manager.PrintJokes();*/

            // Part 2
            UserInterface ui = new UserInterface(manager);

            ui.Start();
        }
Пример #6
0
        public static void Main(string[] args)
        {
            JokeManager   manager = new JokeManager();
            UserInterface ui      = new UserInterface(manager);

            ui.Start();

            /*JokeManager manager = new JokeManager();
             * manager.AddJoke("What is red and smells of blue paint? - Red paint.");
             * manager.AddJoke("What is blue and smells of red paint? - Blue paint.");
             *
             * Console.WriteLine("Drawing jokes:");
             * for (int i = 0; i < 5; i++)
             * {
             *  Console.WriteLine(manager.DrawJoke());
             * }
             *
             * Console.WriteLine("");
             * Console.WriteLine("Printing jokes:");
             * manager.PrintJokes();*/
            /*List<string> jokes = new List<string>();
             * Console.WriteLine("What a joke!");
             *
             * while (true)
             * {
             * Console.WriteLine("Commands:");
             * Console.WriteLine(" 1 - add a joke");
             * Console.WriteLine(" 2 - draw a joke");
             * Console.WriteLine(" 3 - list jokes");
             * Console.WriteLine(" X - stop");
             *
             * string command = Console.ReadLine();
             *
             * if (command == "X")
             * {
             *  break;
             * }
             *
             * if (command == "1")
             * {
             *  Console.WriteLine("Write the joke to be added:");
             *  string joke = Console.ReadLine();
             *  jokes.Add(joke);
             * }
             * else if (command == "2")
             * {
             *  Console.WriteLine("Drawing a joke.");
             *
             *  if (jokes.Count == 0)
             *  {
             *    Console.WriteLine("Jokes are in short supply.");
             *  }
             *  else
             *  {
             *    Random draw = new Random();
             *    int index = draw.Next(0, jokes.Count);
             *    Console.WriteLine(jokes[index]);
             *  }
             *
             * }
             * else if (command == "3")
             * {
             *  Console.WriteLine("Printing the jokes.");
             *  foreach (string joke in jokes)
             *  {
             *    Console.WriteLine(joke);
             *  }
             * }
             * }*/
        }