-
Notifications
You must be signed in to change notification settings - Fork 0
/
sudokuLib.h
68 lines (56 loc) · 1.69 KB
/
sudokuLib.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <cstddef>
#ifndef SUDOKU_LIB_H
#define SUDOKU_LIB_H
//the number of elements for each square (always 10 in Sudoku
#define NUM_ELEMENTS 9
/*
* sudoko namespace implements useful classes for
* evaluating the solutions to sudoku puzzles
*/
namespace sudoku {
/*
* Attributes:
* d is the data, array of bools. True if this entry could be that element
* def_freedom is the total number of Trues in d
*/
class PredEntry {
private:
bool d[NUM_ELEMENTS];
unsigned short deg_freedom;
public:
/*
* Constructer initializes its data array to trues
* initializes deg_freedom to NUM_ELEMENTS
*/
PredEntry();
};
/*
* printHello is a prints "hello world"
* it's purpose is to help me remember the syntax
* of how this three file import system works in c++
* until I've got more functions going.
*/
void PrintHello();
class SudokuBoard{
private:
short** board; //2x2 array board
// question here: Would it be clearer to use a struct or typedef?
PredEntry*** predBoard; // board of predictions
const size_t size; // width of board (same as height)
public:
/*
* constructor initializes the board by copying
* the array passed into it's board
* params:
* const short[][] board: the sudoku board
* const int size: the width of the board (board is assumed square)
*/
SudokuBoard(short** board, const size_t size);
~SudokuBoard();
//I'm not sure why this can't be const at the begining or if it should
//be. TODO figure out what is happening
short** getBoard() const;
const size_t getSize() const;
};
}
#endif