Exemplo n.º 1
0
        private static void WriteZebraSolutionToConsole(SolutionTable solution)
        {
            var ownerNationality = solution.Rows
                                   .Where(row => row.Pet.Equals(Pet.Zebra))
                                   .Select(owner => owner.Nationality).Single();

            WriteLine("The {0} owns the Zebra.{1}", ownerNationality,
                      Environment.NewLine);
        }
Exemplo n.º 2
0
 private static void WriteSolutionForAllTheHousesToConsole(
     SolutionTable solution)
 {
     WriteLine("House Colour Drink  Nationality Smokes     Pet");
     WriteLine("───── ────── ────── ─────────── ────────── ─────");
     solution.Rows.ForEach(
         row => WriteLine("{0,5} {1,-6} {2,-6} {3,-11} {4,-10} {5,-10}",
                          row.HouseNumber, row.HouseColour, row.Drink, row.Nationality,
                          row.Smoke, row.Pet));
 }