コード例 #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
ファイル: Program.cs プロジェクト: anwachuku15/CSharp
        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
ファイル: Program.cs プロジェクト: Trogers32/C_Sharp_Stack
        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
ファイル: Program.cs プロジェクト: CHillAaron/csharp
        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
ファイル: Program.cs プロジェクト: brycealderete/CodingDojo
        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
ファイル: Program.cs プロジェクト: Nassertakkesh/C-Sharp
        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
ファイル: Program.cs プロジェクト: Sombat/C-Sharp-Practice
        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
ファイル: Program.cs プロジェクト: richminlee/CSharp_Stack
        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
ファイル: Program.cs プロジェクト: trekre243/language
        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
ファイル: Program.cs プロジェクト: Jpgarrett24/Hungry-Ninja
        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
ファイル: Program.cs プロジェクト: faisalsrs/coding_files
            static void Main(string[] args)
            {
                Buffet AYCE   = new Buffet();
                Ninja  Faisal = new Ninja();

                while (Faisal.IsFull != true)
                {
                    Faisal.Eat(AYCE.Serve());
                }
            }
コード例 #25
0
ファイル: Program.cs プロジェクト: aytan-cohen/HungryNinja
        static void Main(string[] args)
        {
            Buffet b  = new Buffet();
            Ninja  ay = new Ninja("Aytan");

            while (!ay.IsFull)
            {
                ay.Eat(b.Serve());
            }
        }
コード例 #26
0
        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
ファイル: Program.cs プロジェクト: bryanb213/C-_Stack
        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!");
        }