コード例 #1
0
            public void Find(Solwrt solwrt)
            {
                SolutionFinder finder    = new SolutionFinder();
                IList          solutions = finder.FindSolutions(new KnightSolutionEnumerator(hatesMap, needsMap, KnigtsNumber));

                foreach (KnightSolution solution in solutions)
                {
                    solwrt.Write(solution.ToString());
                }
            }
コード例 #2
0
ファイル: Board.cs プロジェクト: jweber/bbplayer
        public Solution[] FindSolutions(Solution previousSolution)
        {
            var solutionFinder = new SolutionFinder(this);
            var solutions      = solutionFinder.FindSolutions(previousSolution);

            if (solutions == null)
            {
                return(new Solution[0]);
            }

            return(solutions.ToArray());
        }
コード例 #3
0
ファイル: SolutionFinderTester.cs プロジェクト: xeno3/fubumvc
        public void find_multiples_so_it_is_indeterminate()
        {
            fileSystem.CreateDirectory("multiples");
            fileSystem.CleanDirectory("multiples");
            fileSystem.WriteStringToFile("multiples".AppendPath("anything.sln"), "whatever");
            fileSystem.WriteStringToFile("multiples".AppendPath("else.sln"), "whatever");

            Environment.CurrentDirectory = Environment.CurrentDirectory.AppendPath("multiples").ToFullPath();


            SolutionFinder.FindSolutionFile().ShouldBeNull();

            // find the multiples too
            var solutions = SolutionFinder.FindSolutions();

            solutions.ShouldHaveTheSameElementsAs(
                "anything.sln", "else.sln");
        }