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