xref: /haiku/src/apps/sudoku/SudokuSolver.h (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef SUDOKU_SOLVER_H
6 #define SUDOKU_SOLVER_H
7 
8 
9 #include <vector>
10 
11 #include <SupportDefs.h>
12 
13 class SudokuField;
14 
15 class SudokuSolver {
16 public:
17 	SudokuSolver(SudokuField* field);
18 	SudokuSolver();
19 	~SudokuSolver();
20 
21 	void SetTo(SudokuField* field);
22 
23 	void ComputeSolutions();
24 
25 	uint32 CountSolutions();
26 	SudokuField* SolutionAt(uint32 index);
27 
28 private:
29 	void _MakeEmpty();
30 
31 	typedef std::vector<SudokuField*> SudokuList;
32 
33 	SudokuField*	fField;
34 	SudokuList		fSolutions;
35 };
36 
37 #endif	// SUDOKU_SOLVER_H
38