private BoardStatistics GetBoardStatistics(string hash) { var board = (new BoardHash()).LoadFromHash(hash); var possibilityCalculator = GetPossibilityCalculator(board); var boardStatistics = new BoardStatistics(board, possibilityCalculator); return(boardStatistics); }
public void GetTotalFieldsTest() { // Arrange var board = new Board(); var boardStatistics = new BoardStatistics(board, GetPossibilityCalculator(board)); // Act var fields = boardStatistics.GetTotalFields(); // Assert Assert.AreEqual(81, fields); }
static void Main(string[] args) { System.Console.WriteLine("Insert the board hash as 1 long line:"); var hash = System.Console.ReadLine(); var boardHash = new BoardHash(); var stats = new BoardStatistics(boardHash.LoadFromHash(hash), new PossibilityCalculator(boardHash.LoadFromHash(hash))); System.Console.WriteLine($"\n\nStarting solving. There are {stats.GetPossibilities()} possibilities.."); var solver = new BruteForceSolver(); var result = solver.Solve((new BoardHash()).LoadFromHash(hash)); System.Console.WriteLine($"Solved in {solver.Attempts} attempts.\n\n"); OutputBoard(result); }