Esempio n. 1
0
        static void Main(string[] args)
        {
            var gandalf = new Gandalf();
            var input   = Console.ReadLine().Split();

            foreach (var s in input)
            {
                gandalf.Foods.Add(s);
            }
            gandalf.CalculateHappiness();
            gandalf.CalculateMood();
            Console.WriteLine(gandalf.Happiness);
            Console.WriteLine(gandalf.Mood);
        }
    public static void Main()
    {
        string[] input = Console.ReadLine().ToLower().Split();

        Gandalf gandalf = new Gandalf();

        foreach (var food in input)
        {
            gandalf.EatFood(food);
        }

        Console.WriteLine(gandalf.Happiness);
        Console.WriteLine(gandalf.CalculateMood());
    }
Esempio n. 3
0
        public static void Main()
        {
            var foods = Console.ReadLine()
                        .ToLower()
                        .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            var gandalf = new Gandalf();

            foreach (var food in foods)
            {
                gandalf.EatFood(food);
            }

            Console.WriteLine(gandalf.HappinessPoints);
            Console.WriteLine(gandalf.CalculateMood());
        }