]> git.itanic.dy.fi Git - sudoku/blob - sudoku.h
Initial commit
[sudoku] / sudoku.h
1 #ifndef SUDOKU_H
2 #define SUDOKU_H
3
4 #include <vector>
5
6 extern int guesses;
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();
25
26         int recursion_depth;
27 private:
28
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