-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsulve.h
44 lines (38 loc) · 890 Bytes
/
sulve.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
/*
* sulve.h
*
* Created on: Feb 23, 2011
* Author: meiskam ([email protected])
* Copyright: All rights reserved, do not edit, do not redistribute. Subject to change without notice.
*/
#ifndef SULVE_H_
#define SULVE_H_
#include <list>
using namespace std;
class SudokuCell {
public:
int mValue;
int mLocked;
list<int> mAvail;
SudokuCell() { mValue = 0; mLocked = 0; };
void set(int a) { mValue = a; mAvail.remove(a); };
};
class SudokuGrid {
public:
int mSize;
vector<vector<SudokuCell> > values;
SudokuGrid(int size) {
mSize = size;
values.resize(mSize);
for (int i=0; i<mSize; i++) values.at(i).resize(mSize);
}
SudokuCell* at(int i, int j) {
return &(values.at(i).at(j));
}
};
int _rand(int);
int _rand() { return _rand(9); };
void _display(SudokuGrid*);
void _fakegen(SudokuGrid*);
void _doit(SudokuGrid*);
#endif /* SULVE_H_ */