예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            // Test Food class:
            // Food Pizza = new Food("Pizza", 1200, true, false);
            // Console.WriteLine($"Name: {Pizza.Name}, Calories {Pizza.Calories}, Spicy: {Pizza.IsSpicy}, Sweet: {Pizza.IsSweet}.");

            // Test Buffet class:
            Buffet GoldenCorral = new Buffet();
            // Console.WriteLine(GoldenCorral.Serve().Name);
            // Console.WriteLine(GoldenCorral.Serve().Name);

            // Test Ninja class:
            Ninja Wadoo = new Ninja();

            //Console.WriteLine($"Calorie intake: {Wadoo.CalorieIntake}"); // Get method
            //Console.WriteLine($"Calorie intake: {Wadoo.CalorieIntake = 1201}"); // Set method
            //Console.WriteLine(Wadoo.IsFull); // IsFull method

            // In your Program's Main method, instantiate a Buffet and Ninja object, and have the Ninja eat until they are full!
            while (Wadoo.CalorieIntake < 1200)
            {
                Wadoo.Eat(GoldenCorral.Serve());
            }
            Wadoo.Eat(GoldenCorral.Serve());
        }
예제 #2
0
        static void Main(string[] args)
        {
            Ninja Sam = new Ninja();

            Sam.Eat();
            Sam.Eat();
            Sam.Eat();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Buffet myBuffet = new Buffet();
            Ninja  myNinja  = new Ninja();

            myNinja.Eat(myBuffet.Serve());
            myNinja.Eat(myBuffet.Serve());
            myNinja.Eat(myBuffet.Serve());
            myNinja.Eat(myBuffet.Serve());
        }
예제 #4
0
        static void Main(string[] args)
        {
            Buffet b1  = new Buffet();
            Ninja  tim = new Ninja();

            tim.Eat(b1.Serve());
            tim.Eat(b1.Serve());
            tim.Eat(b1.Serve());
            tim.Eat(b1.Serve());
        }
예제 #5
0
        static void Main(string[] args)
        {
            Buffett buffett1 = new Buffett();
            Ninja   Ninja1   = new Ninja();

            Ninja1.Eat(buffett1.Serve());
            Ninja1.Eat(buffett1.Serve());
            Ninja1.Eat(buffett1.Serve());
            Ninja1.Eat(buffett1.Serve());
        }
예제 #6
0
파일: Program.cs 프로젝트: denys-glu/CSharp
        static void Main(string[] args)
        {
            Ninja  Samurai = new Ninja();
            Buffet Pho     = new Buffet();

            Samurai.Eat(Pho.Serve());
            Samurai.Eat(Pho.Serve());
            Samurai.Eat(Pho.Serve());
            Samurai.Eat(Pho.Serve());
        }
예제 #7
0
        static void Main(string[] args)
        {
            Ninja  ninja  = new Ninja();
            Buffet buffet = new Buffet();

            while (!ninja.IsFull)
            {
                ninja.Eat(buffet.Serve());
            }
            ninja.Eat(buffet.Serve());
        }
예제 #8
0
        static void Main(string[] args)
        {
            Buffet myBuffet = new Buffet();
            Ninja  myNinja  = new Ninja();

            do   // Continue eating until full
            {
                myNinja.Eat(myBuffet.Serve());
            } while (myNinja.isFull == false);
            myNinja.Eat(myBuffet.Serve()); // Eat one more time to console log that the ninja is full
        }
예제 #9
0
        static void Main(string[] args)
        {
            Buffet Gege  = new Buffet();
            Ninja  Eddie = new Ninja(2200);

            while (!Eddie.IsFull)
            {
                Eddie.Eat(Gege.Serve());
            }
            Eddie.Eat(Gege.Serve());
        }
예제 #10
0
        static void Main(string[] args)
        {
            Buffet pigout = new Buffet();
            Ninja  Bobby  = new Ninja();

            Bobby.Eat(pigout.Serve());
            Bobby.Eat(pigout.Serve());
            Bobby.Eat(pigout.Serve());
            Bobby.Eat(pigout.Serve());
            Bobby.Eat(pigout.Serve());
        }
예제 #11
0
        static void Main(string[] args)
        {
            Ninja  Bryce    = new Ninja();
            Buffet hometown = new Buffet();

            Bryce.Eat(hometown.Serve());
            Bryce.Eat(hometown.Serve());
            Bryce.Eat(hometown.Serve());
            Bryce.Eat(hometown.Serve());
            Bryce.Eat(hometown.Serve());
        }
예제 #12
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Buffet newBuffet = new Buffet();

            newBuffet.Serve();
            Ninja ninja1 = new Ninja();

            while (!ninja1.isFull)
            {
                ninja1.Eat(newBuffet.Serve());
            }
            ninja1.Eat(newBuffet.Serve());
        }
예제 #13
0
        static void Main(string[] args)
        {
            var firstNinja  = new Ninja();
            var firstBuffet = new Buffet();

            // only eat while not true
            while (firstNinja.IsFull != true)
            {
                var food = firstBuffet.Serve(); // returns a random food item
                firstNinja.Eat(food);
            }

            firstNinja.Eat(firstBuffet.Serve()); // testing our console warning
        }
예제 #14
0
        static void Main(string[] args)
        {
            Buffet BuffetMari = new Buffet();
            Ninja  Sombat     = new Ninja("Sombat");

            while (!Sombat.isFull)
            {
                Sombat.Eat(BuffetMari.Serve());
            }
            foreach (var Item in Sombat.Stomach)
            {
                Console.WriteLine($"{Item.Name} {Item.Calories}");
            }
            Sombat.Eat(BuffetMari.Serve());
        }
예제 #15
0
        static void Main(string[] args)
        {
            //name of class
            var firstNinja = new Ninja();
            var firstBuffet = new Buffet();
            // var firstFoodHistory = new Ninja();

            while(!firstNinja.isFull)
            {
                var food = firstBuffet.Serve();
                firstNinja.Eat(food);
            }
            //the ninja is full
            firstNinja.Eat(firstBuffet.Serve());
        }
예제 #16
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.Red;
            Console.WriteLine("༼ ༽ RICE BUFFET ༼ ༽");
            Console.WriteLine("you ate all my food ninja !!!");
            Console.ResetColor();
            Ninja  client = new Ninja();
            Buffet buffet = new Buffet();

            while (!client.IsFull)
            {
                client.Eat(buffet.Serve());
            }
            client.Eat(buffet.Serve());
        }
예제 #17
0
        static void Main(string[] args)
        {
            Buffet country = new Buffet();
            Ninja  Richard = new Ninja();
            Food   meal1   = country.Serve();

            Richard.Eat(meal1);
            Food meal2 = country.Serve();

            Richard.Eat(meal2);
            Food meal3 = country.Serve();

            Richard.Eat(meal3);
            Food meal4 = country.Serve();

            Richard.Eat(meal4);
        }
예제 #18
0
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();

            buffet.Menu.Add(new Food("Pizza", 500, false, false));
            buffet.Menu.Add(new Food("Ice Cream", 400, false, true));
            buffet.Menu.Add(new Food("Cheeseburger", 550, false, false));
            buffet.Menu.Add(new Food("Tacos", 400, true, false));

            Ninja tom = new Ninja();

            while (tom.IsFull != true)
            {
                tom.Eat(buffet.Serve());
            }
            tom.Eat(buffet.Serve());
        }
예제 #19
0
        static void Main(string[] args)
        {
            Buffet mybuffet = new Buffet();
            Ninja  N1       = new Ninja();

            N1.Eat(mybuffet);
            // Food food = mybuffet.Serve();
            // System.Console.WriteLine($"{food.Name}");
        }
예제 #20
0
        static void Main(string[] args)
        {
            // [x] In your Program's Main method, instantiate a Buffet and Ninja object, and have the Ninja eat until they are full!

            Buffet buffet = new Buffet();
            // buffet.Serve();
            Ninja ninja = new Ninja();

            // only eat while ninja is not full
            while (!ninja.IsFull)
            {
                // ninja.Eat(buffet.Serve());
                var food = buffet.Serve(); //returns a random food item
                ninja.Eat(food);
            }
            ninja.Eat(buffet.Serve());
            // Console.WriteLine("ninja is full and cannot eat anymore!");
        }
예제 #21
0
        static void Main(string[] args)
        {
            Buffet royalFork = new Buffet();
            Ninja  sotomu    = new Ninja();

            while (!sotomu.IsFull)
            {
                sotomu.Eat(royalFork.Serve());
            }
        }
예제 #22
0
        static void Main(string[] args)
        {
            Buffet DojoCafe = new Buffet();
            Ninja  joe      = new Ninja();

            while (!joe.IsFull)
            {
                joe.Eat(DojoCafe.Serve());
            }
        }
예제 #23
0
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();
            Ninja  ninja  = new Ninja();

            while (ninja.IsFull != true)
            {
                ninja.Eat(buffet.Serve());
            }
        }
예제 #24
0
            static void Main(string[] args)
            {
                Buffet AYCE   = new Buffet();
                Ninja  Faisal = new Ninja();

                while (Faisal.IsFull != true)
                {
                    Faisal.Eat(AYCE.Serve());
                }
            }
예제 #25
0
        static void Main(string[] args)
        {
            Buffet b  = new Buffet();
            Ninja  ay = new Ninja("Aytan");

            while (!ay.IsFull)
            {
                ay.Eat(b.Serve());
            }
        }
        static void Main(string[] args)
        {
            Ninja  yudong     = new Ninja();
            Buffet stuffToEat = new Buffet();

            while (yudong.IsFull != true)
            {
                yudong.Eat(stuffToEat.Serve());
            }
        }
예제 #27
0
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();
            Ninja  ninja  = new Ninja();

            while (!ninja.isFull)
            {
                Food food = buffet.Serve();
                ninja.Eat(food);
            }
        }
예제 #28
0
        static void Main(string[] args)
        {
            Buffet ninjaBuffet = new Buffet();
            Ninja  kirill      = new Ninja();

            while (kirill.isFull == false)
            {
                kirill.Eat(ninjaBuffet.Serve());
                Console.WriteLine($"Calories: {kirill.calories}\nYour ninja is full.");
            }
        }
예제 #29
0
        static void Main(string[] args)
        {
            Ninja  mitchell = new Ninja("Mitchell");
            Buffet daBuffet = new Buffet();

            while (mitchell.isFull == false)
            {
                mitchell.Eat(daBuffet.Serve());
            }
            Console.WriteLine(mitchell.FoodHistory);
        }
예제 #30
0
        static void Main(string[] args)
        {
            Buffet mybuffet = new Buffet();
            Ninja  myNinja  = new Ninja();

            while (myNinja.IsFull == false)
            {
                myNinja.Eat(mybuffet.Serve());
            }
            System.Console.WriteLine("Done!");
        }