Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var NewFood1 = new Food("Chocolate", 300, false, true);
            var NewFood2 = new Food("La Tiao", 100, true, false);

            Console.WriteLine($"Food Name: {NewFood1.Name} has {NewFood1.Calories} calories, and it is spicy ({NewFood1.IsSpicy}) instead of sweet ({NewFood1.IsSweet})");

            Buffet NewMenu = new Buffet();

            NewMenu.Serve();
            Console.WriteLine($"Random food is '{NewMenu.Serve().Name}'");

            var NewNinja = new Ninja("Ling");

            Console.WriteLine($"{NewNinja.Name} is {NewNinja.IsFull}");
            Console.WriteLine($"This {NewNinja.Name} Welcome!");
            NewNinja.Eat(NewMenu.Serve());
            Console.WriteLine($"{NewNinja.CalorieProp}");

            while (NewNinja.IsFull == false)
            {
                NewNinja.Eat(NewMenu.Serve());
            }
            Console.WriteLine($"Warning: calorie intake is {NewNinja.CalorieProp}. The ninja is full and cannot eat anymore!");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            SpiceHound spicy   = new SpiceHound();
            SweetTooth sweet   = new SweetTooth();
            Buffet     buffet1 = new Buffet();

            Console.WriteLine("Spicy is eating...");
            while (!spicy.IsFull())
            {
                spicy.Consume(buffet1.Serve());
            }
            Console.WriteLine($"Spicy ate {spicy.ConsumptionHistory.Count} items.");

            Console.WriteLine("Sweet is eating...");
            while (!sweet.IsFull())
            {
                sweet.Consume(buffet1.Serve());
            }
            Console.WriteLine($"Spicy ate {sweet.ConsumptionHistory.Count} items.");

            if (spicy.ConsumptionHistory.Count > sweet.ConsumptionHistory.Count)
            {
                Console.WriteLine("Spicy ate more!");
            }
            else if (spicy.ConsumptionHistory.Count < sweet.ConsumptionHistory.Count)
            {
                Console.WriteLine("Sweet ate more!");
            }
            else
            {
                Console.WriteLine("It's a tie!");
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Buffet newBuffet  = new Buffet();
            Ninja  firstNinja = new Ninja();

            firstNinja.Eat(newBuffet.Serve());
            firstNinja.Eat(newBuffet.Serve());
            firstNinja.Eat(newBuffet.Serve());
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Buffet thisbuffet = new Buffet();
            Food   newfood    = thisbuffet.Serve();
            Ninja  ninjaone   = new Ninja();

            ninjaone.Eat(newfood);
            System.Console.WriteLine(ninjaone.FoodHistory);
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Buffet NinjaFood = new Buffet();
            Ninja  Kevin     = new Ninja();

            while (Kevin.IsFull == false)
            {
                Kevin.Eat(NinjaFood.Serve());
            }
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            Buffet World  = new Buffet();
            Ninja  Fabian = new Ninja();

            while (Fabian.IsFull == false)
            {
                Fabian.Eat(World.Serve());
            }
        }
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();
            Ninja  ninja  = new Ninja();

            ninja.Eat(buffet.Serve());
            ninja.Eat(buffet.Serve());
            ninja.Eat(buffet.Serve());
            ninja.Eat(buffet.Serve());
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();
            Ninja  ninja  = new Ninja();

            while (!ninja.IsFull)
            {
                ninja.Eat(buffet.Serve());
            }
        }
        static void Main(string[] args)
        {
            Buffet buffet1 = new Buffet();
            Ninja  ninja1  = new Ninja();

            while (ninja1.IsFull == false)
            {
                ninja1.Eat(buffet1.Serve());
            }
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            var joeNinja  = new Ninja("");
            var joeBuffet = new Buffet();

            while (joeNinja.IsFull != true)
            {
                var food = joeBuffet.Serve();
                joeNinja.Eat(food);
            }
        }
        static void Main(string[] args)
        {
            Buffet buffet = new Buffet();
            Ninja  neil   = new Ninja();

            while (!neil.IsFull)
            {
                Food dish = buffet.Serve();
                neil.Eat(dish);
            }
            Console.WriteLine("Neil is full...");
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            // Console.WriteLine("Hello World!");
            Buffet codingdojo = new Buffet();
            Ninja  jon        = new Ninja();

            jon.Eat(codingdojo.Serve());
            jon.Eat(codingdojo.Serve());
            jon.Eat(codingdojo.Serve());
            jon.Eat(codingdojo.Serve());
            jon.Eat(codingdojo.Serve());
        }
Beispiel #13
0
        static void Main(string[] args)
        {
            Buffet oriental = new Buffet();

            Ninja armin = new Ninja();

            armin.Eat(oriental.Serve());
            armin.Eat(oriental.Serve());
            armin.Eat(oriental.Serve());


            Console.WriteLine("Hello World!");
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            Buffet NinjaBuffet = new Buffet();

            NinjaBuffet.Serve();
            Ninja Hayabusa = new Ninja();

            Hayabusa.Eat(NinjaBuffet.Serve());
            Hayabusa.Eat(NinjaBuffet.Serve());
            Hayabusa.Eat(NinjaBuffet.Serve());
            Hayabusa.Eat(NinjaBuffet.Serve());
            Hayabusa.Eat(NinjaBuffet.Serve());
        }
Beispiel #15
0
    { static void Main(string[] args)
      {
          Buffet b1 = new Buffet(); //to create a new instance of a class, you typically invoke one of the constructors of that type using the "new" operator.

          b1.Serve();               //prints out random food items
          Ninja n1 = new Ninja();   //testing isFull method

          for (int i = 0; i < 10; i++)
          {
              Console.WriteLine(n1.isFull);
              n1.Eat(b1.Serve());
          }
      }
Beispiel #16
0
 // build out the Eat method
 public void Eat()
 {
     if (calorieIntake >= 1200)
     {
         Console.WriteLine("The ninja is full and can not eat anymore.");
     }
     else
     {
         Food item     = Buffet.Serve();
         int  calories = calorieIntake += item.Calories;
         Console.WriteLine($"The ninja has {calories} calories");
     }
 }
Beispiel #17
0
        static void Main(string[] args)
        {
            Buffet NinjasBuffet = new Buffet();
            Ninja  David        = new Ninja();

            while (David.IsFull == false)
            {
                David.Eat();
            }
            if (David.IsFull == true)
            {
                Console.WriteLine("The ninja is full");
            }
        }
Beispiel #18
0
        static void Main(string[] args)
        {
            Ninja  Chris = new Ninja();
            Buffet Sushi = new Buffet();

            for (int i = 0; i < 11; i++)
            {
                Food NewFood = Sushi.Serve();
                Chris.Eat(NewFood);
            }
            foreach (var food in Chris.FoodHistory)
            {
                Console.WriteLine(food.Name);
            }
        }
        static void Main(string[] args)
        {
            Buffet myBuffet = new Buffet();

            myBuffet.Serve();
            Ninja Ninja1 = new Ninja();

            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
            Ninja1.Eat(myBuffet.Serve());
        }
Beispiel #20
0
        static void Main(string[] args)
        {
            Ninja  Jake      = new Ninja();
            Buffet NinjaCafe = new Buffet();

            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
            Jake.Eat(NinjaCafe.Serve());
        }
Beispiel #21
0
        static void Main(string[] args)
        {
            Buffet     yummy = new Buffet();
            SweetTooth kyle  = new SweetTooth();
            SpiceHound dude  = new SpiceHound();

            while (!kyle.IsFull)
            {
                kyle.Consume(yummy.Serve());
            }
            if (kyle.ConsumptionHistory.Count > dude.ConsumptionHistory.Count)
            {
                Console.WriteLine($"SweetTooth had the most items consumed with {kyle.ConsumptionHistory.Count} items!");
            }
            else
            {
                Console.WriteLine($"SweetTooth had the most items consumed with {dude.ConsumptionHistory.Count} items!");
            }
        }