-
Notifications
You must be signed in to change notification settings - Fork 0
/
SudokuBase.h
37 lines (33 loc) · 1.13 KB
/
SudokuBase.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
#ifndef SUDOKU_BASE_H
#define SUDOKU_BASE_H
#include <cstring>
#include <ostream>
using namespace std;
class SudokuBase
{
public:
enum Status{Unknown, Full, Empty, NotEmpty, Paradoxical};
typedef unsigned short u_short;
const static u_short Order = 3;
const static u_short RowInFloor = Order;
const static u_short ColInTower = Order;
const static u_short Tower = Order;
const static u_short Floor = Order;
const static u_short Row = RowInFloor * Floor;
const static u_short Col = ColInTower * Tower;
const static u_short Block = Tower * Floor;
const static u_short NumberRange = Order*Order+1;
const static u_short CellAmount = Row * Col;
typedef u_short Map[Row][Col];
u_short GetNumber(u_short r, u_short c) const;
SudokuBase();
SudokuBase(const SudokuBase & other);
SudokuBase & operator=(const SudokuBase & other);
friend ostream & operator<<(ostream &os, const SudokuBase &s);
protected:
const static u_short MinStep = 17;
Map map;
void Copy(const SudokuBase & other);
};
const char * StatusToString(SudokuBase::Status s);
#endif