static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Ninja Buffet!");
            Buffet     worldclass = new Buffet();
            SpiceHound robby      = new SpiceHound();
            SweetTooth bobby      = new SweetTooth();

            while (!robby.IsFull)
            {
                robby.Consume(worldclass.Serve());
                if (robby.IsFull)
                {
                    robby.Consume(worldclass.Serve());
                }
            }
            while (!bobby.IsFull)
            {
                bobby.Consume(worldclass.Serve());
                if (bobby.IsFull)
                {
                    bobby.Consume(worldclass.Serve());
                }
            }
            if (bobby.ConsumptionHistory.Count > robby.ConsumptionHistory.Count)
            {
                System.Console.WriteLine($"SweetTooth at more food! A total of {bobby.ConsumptionHistory.Count}");
            }
            else
            {
                System.Console.WriteLine($"SpiceHound at more food! A total of {robby.ConsumptionHistory.Count}");
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Making a Buffet Ojbect
            Buffet buffet1 = new Buffet();

            // Making a SweetTooth Object
            SweetTooth sweet = new SweetTooth();

            // Making a SpiceHound Object
            SpiceHound spice = new SpiceHound();

            // Making sweet Consume
            System.Console.WriteLine("SweetTooth consuming...");
            sweet.Consume(buffet1.Serve());
            sweet.Consume(buffet1.Serve());
            sweet.Consume(buffet1.Serve());
            sweet.Consume(buffet1.Serve());
            sweet.Consume(buffet1.Serve());

            // spice consuming
            System.Console.WriteLine("SpiceHound consuming...");
            spice.Consume(buffet1.Serve());
            spice.Consume(buffet1.Serve());
            spice.Consume(buffet1.Serve());
            spice.Consume(buffet1.Serve());
            spice.Consume(buffet1.Serve());
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            SweetTooth MichaelChoi = new SweetTooth("Michael Choi");
            SpiceHound CodingNinja = new SpiceHound("Coding Ninja");
            Buffet     Buffet      = new Buffet();

            MichaelChoi.Consume(Buffet.Serve());
            MichaelChoi.Consume(Buffet.Serve());
            MichaelChoi.Consume(Buffet.Serve());
            MichaelChoi.Consume(Buffet.Serve());
            MichaelChoi.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            CodingNinja.Consume(Buffet.Serve());
            Console.WriteLine("MihcaelChoi consumed 5 items, CodingNinja consumed 8 items.");
        }