Exemple #1
0
        private static void ShowTheSuggessionToThePaperBoyOnApprachOne(PaperBoyHelper paperBoyHelper, IEnumerable <int> houseNumbers)
        {
            var deliveryOrderInApproachOne = paperBoyHelper.GetHouseNumbersOfNorthFromWestToEast(houseNumbers);

            paperBoyHelper.UpdateTotalCrossing();
            deliveryOrderInApproachOne = paperBoyHelper.GetDeliveryOrderOnSecondRoundEastToWest(houseNumbers, deliveryOrderInApproachOne);

            Console.WriteLine("Approach 1: Houses to deliver in order are {0}", string.Join(",", deliveryOrderInApproachOne));
            Console.WriteLine("Approach 1: Total crossing time is: {0}", paperBoyHelper.GetTotalCrossingCount());
        }
Exemple #2
0
        private static void ShowTheSuggessionToThePaperBoyOnApprachTwo(PaperBoyHelper paperBoyHelper, IEnumerable <int> houseNumbers)
        {
            var deliveryOrderInApproachTwo = new List <int>();
            var houseQueue = paperBoyHelper.GetHouseQueue(houseNumbers);

            paperBoyHelper.DeliverNewsPaperFromWestToEast(Side.North, deliveryOrderInApproachTwo, houseQueue);

            Console.WriteLine();
            Console.WriteLine("Approach 2: Houses to deliver in order are {0}", string.Join(",", deliveryOrderInApproachTwo));
            Console.WriteLine("Approach 2: Total crossing time is: {0}", paperBoyHelper.GetTotalCrossingCount());
        }