-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSudoku.h
41 lines (33 loc) · 932 Bytes
/
Sudoku.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef SUDOKU_H
#define SUDOKU_H
#include <iostream>
#include <vector>
using std::vector;
class Sudoku {
private:
// Data fields
char** board;
static const int SIZE;
static const char BLANK;
vector<char> digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
int count; // Stores the number of solutions found
// Functions
int nextRowIndex(int, int) const;
int nextColIndex(int, int) const;
bool inSameRow(int, char) const;
bool inSameCol(int, char) const;
bool inSameGrid(int, int, char) const;
void solve(int, int, std::ostream&);
public:
// Constructors
Sudoku(); // Default constructor
Sudoku(const Sudoku&); // Copy constructor
// Destructor
~Sudoku();
// Functions
const Sudoku& operator = (const Sudoku&);
void loadData(std::istream&);
void solve(std::ostream&);
void printSolution(std::ostream&) const;
};
#endif