コード例 #1
0
 private static void DrawSolution(Solution solution)
 {
     foreach (var line in Pentominoes.FormatSolution(solution))
     {
         Console.WriteLine(line);
     }
     Console.WriteLine(new string('-', 80));
 }
コード例 #2
0
        static void Main(string[] args)
        {
            var solutions      = Pentominoes.Solve();
            var solutionsCount = solutions.Aggregate(0, (acc, solution) =>
            {
                DrawSolution(solution);
                return(acc + 1);
            });

            Console.WriteLine($"Number of solutions found: {solutionsCount}");
        }
コード例 #3
0
        public void FindsCorrectNumberOfSolutions()
        {
            var solutions = Pentominoes.Solve();

            Assert.Equal(65, solutions.Count());
        }