]> git.itanic.dy.fi Git - sudoku/blob - sudoku.h
a0b8971f4fe077babc1db2454220f50231752095
[sudoku] / sudoku.h
1 #ifndef SUDOKU_H
2 #define SUDOKU_H
3
4 #include <vector>
5 #include <string>
6
7 extern int verbose;
8
9 class sudoku {
10 public:
11         sudoku();
12         ~sudoku();
13
14         void print(void);
15
16         int set(const int col, const int row, const char num);
17         char get(const int col, const int row);
18
19         // convert a string of numbers to a sudoku row
20         int str_to_row(const int row, const std::string &str);
21
22         std::string get_legal_numbers(const int col, const int row);
23         sudoku solve(int &solvable);
24         std::vector<sudoku> solve_all(void);
25         void generate(int min_guesses);
26
27         int recursion_depth;
28         int guesses;
29
30 private:
31         std::string get_row_contents(const int row);
32         std::string get_col_contents(const int col);
33         std::string get_block_contents(const int col, const int row);
34         int fill_missing();
35         void clone_to(sudoku &to);
36         int get_best_guess(int &col, int &row);
37
38         char table[9][9];
39 };
40
41 #endif