-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolver.hpp
47 lines (42 loc) · 1.33 KB
/
solver.hpp
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
42
43
44
45
46
47
/////////////////////////////////////////////////////////////////////////////////////
// Robert Wagner
// CISC 3410 Assignment #2
// 2016-10-02
// solver.hpp
////////////////////////////////////////////////////////////////////////////////////
#ifndef __SUDOKU_SOLVER_HPP__
#define __SUDOKU_SOLVER_HPP__
#include <string>
#include <map>
#include <deque>
#include <vector>
#include <queue>
#include <sstream>
#include <iostream>
#include <climits>
namespace Sudoku {
class InputEx { // invalid input validation exception handling
private:
char index;
char value;
string msg;
public:
InputEx(char _index, char _value, const string & _msg) :
index(_index), value(_value), msg(_msg) {}
const char getIndex() const { return index; }
const char getValue() const { return value; }
const string & getMsg() const { return msg; }
}; // class InputEx
class Solver {
private:
Board initial;
Board solved;
bool backtrack(Board & prev);
public:
Solver (const string &input);
bool backtrackSearch();
bool isSolved() { return (solved.isSolved()); }
Board solution();
}; // class Solver
} // namespace Sudoku
#endif