Ticket Movie

PHOTO EMBED

Wed Oct 20 2021 14:18:15 GMT+0000 (UTC)

Saved by @_Ryan_ #c#

class Program
    {


        static void Main(string[] args)
        {
            List<string> days235 = new List<string> { "monday", "tuesday", "thursday" };
            List<string> days678 = new List<string> { "friday", "saturday", "sunday" };
            List<string> day4 = new List<string> { "Wednesday" };
            List<string> filmName235 = new List<string>(); //{ "Rich in love", "underwater", "the call" };
            List<string> filmName678 = new List<string>(); //{ "Fantasy Island", "the new mutants", "bloodshot" };
            List<string> filmName4 = new List<string>(); //{"End Game", "Avatar", "Peninsula" };

            displayInterfacey();
            displayStart();

            int option;
            string day;

            Console.SetCursorPosition(44, 3);
            Console.Write("option: ");
            option = int.Parse(Console.ReadLine());

            if (option == 1)
            {
                Console.SetCursorPosition(43, 4);
                Console.Write("Day: ");
                day = Console.ReadLine();
                if (days235.Contains(day))
                {
                    displaySericeStart(filmName235);
                }
                else if (days678.Contains(day))
                {
                    displaySericeStart(filmName678);
                }
                else
                {
                    displaySericeStart(filmName4);
                }
            }
            else if (option == 2)
                displayUpdateFilm(ref filmName235, ref filmName678, ref filmName4);
            else
                displayUpdateSnack();

            Console.ReadKey();

        }
        //======draw interfacey======
        static void displayInterfacey()
        {
            //====draw brand=======
            Console.SetCursorPosition(2, 1);
            Console.Write("\t\t\tWELCOME TO ^KLOVE MOVIE^ CINEMA");
            for (int x = 0; x <= 80; x++)
            {
                Console.SetCursorPosition(x, 0);
                Console.Write("*");
                Console.SetCursorPosition(x, 2);
                Console.Write("*");
            }
            for (int y = 0; y <= 2; y++)
            {
                Console.SetCursorPosition(0, y);
                Console.WriteLine("*");
                Console.SetCursorPosition(80, y);
                Console.WriteLine("*");

            }
            //====draw menu space and box guidance=====
            for (int x = 0; x <= 41; x++)
            {
                Console.SetCursorPosition(x, 25);
                Console.Write("*");
                Console.SetCursorPosition(x, 20);
                Console.Write("*");
          
            }
            for (int y = 21; y < 25; y++)
            {
                for (int x = 0; x < 41; x++)
                {
                    Console.SetCursorPosition(x, y);
                    Console.Write("*");
                }
            }
            
            for (int y = 3; y <= 25; y++)
            {
                Console.SetCursorPosition(0, y);
                Console.WriteLine("*");
                Console.SetCursorPosition(41, y);
                Console.WriteLine("**");
            }
            //=======draw control space=======
            for (int x = 42; x <= 80; x++)
            {
                Console.SetCursorPosition(x, 25);
                Console.Write("*");
            }
            for (int y = 3; y <= 25; y++)
            {
                Console.SetCursorPosition(80, y);
                Console.WriteLine("*");

            }

        }
        static void displayStart()
        {
            int x = 3, y = 3;
            Console.SetCursorPosition(x, y);
            Console.Write("\t-OPTION-");
            Console.SetCursorPosition(x, y + 1);
            Console.Write("[1]. service start");
            Console.SetCursorPosition(x, y + 2);
            Console.Write("[2]. update list film");
            Console.SetCursorPosition(x, y + 3);
            Console.Write("[3]. update list snack");
        }
        static void displaySericeStart(List<string> filmName)
        {
            //==== film , snack;

            for (int y = 3, x = 3, count = 0; y < 7; y++, count++)
            {
                Console.SetCursorPosition(x, y);
                Console.Write($"{count + 1}. {filmName[count]}");
            }
           
           
        }

        static void displayUpdateFilm(ref List<string> filmName235, ref List<string> filmName678, ref List<string> filmName4)
        {                      
                deleteDisplayMenu();
                deleteDisplayControl();

                Console.SetCursorPosition(3, 3);
                Console.WriteLine("\tLIST FILM IN WEEK");
                //=====print 2 - 3 - 5=====
                Console.SetCursorPosition(3, 4);
                if (filmName235.Count == 0)
                    Console.Write("[1]. Day 2-3-5: empty");
                else
                {
                    Console.Write($"[1]. Day 4: {filmName235.Count}");
                }
                //=====print day 6 - 7 - wk =======
                Console.SetCursorPosition(3, 5);
                if (filmName678.Count == 0)
                    Console.Write("[2]. Day 6-7-wk: empty");
                else
                {
                    Console.Write($"[2]. Day 4: {filmName678.Count}");
                }
                Console.SetCursorPosition(3, 6);
                //=====print Day 4======
                if (filmName4.Count == 0)
                    Console.Write("[3]. Day 4: empty");
                else
                {
                    Console.Write($"[3]. Day 4: {filmName4.Count}");
                }                               
        }

        static void displayUpdateSnack()
        {

        }
       

        static void displayMenuFilm(List<string> filmName)
        {                          
            for (int y = 5, print = 0; print < filmName.Count; y++, print++)
            {
                    Console.SetCursorPosition(1, y);
                    Console.WriteLine($"{print + 1}. {filmName[print]}");
            }                         
        }

        

        static void deleteDisplayMenu()
        {
            for (int y = 3; y <= 24; y++)
            {   
                if(y != 20)
                {
                    Console.SetCursorPosition(1, y);
                    Console.WriteLine("                                        ");
                }              
            }
            
        }

        static void deleteDisplayControl()
        {
            for (int y = 3; y <= 20; y++)
            {
                Console.SetCursorPosition(43, y);
                Console.WriteLine("                            ");
            }

        }
    }
content_copyCOPY