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

            foreach (var food in eatenFoods)
            {
                gandalf.EatFood(FoodFactory.GetFood(food));
            }

            Console.WriteLine(gandalf);
        }
Esempio n. 2
0
    static void Main()
    {
        string[] foods = Console.ReadLine().Split();

        Gandalf gandalf = new Gandalf();

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

        Console.WriteLine(gandalf);
    }
Esempio n. 3
0
    private static Gandalf FeedGandalf()
    {
        var foods = Console.ReadLine().ToLower().Split();

        var gandalf = new Gandalf();

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

        return(gandalf);
    }
Esempio n. 4
0
    static void Main(string[] args)
    {
        var foods = Console.ReadLine().ToLower().Split(' ', StringSplitOptions.RemoveEmptyEntries);

        var gandalf = new Gandalf();

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

        Console.WriteLine(gandalf.HappinessPoints);
        Console.WriteLine(gandalf.GetMood());
    }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Gandalf gandalf = new Gandalf();
            var     input   = Console.ReadLine()
                              .Split(' ')
                              .ToList();

            for (int i = 0; i < input.Count; i++)
            {
                gandalf.EatFood(input[i]);
            }

            Console.Write(gandalf);
        }
    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. 7
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());
        }