-
Notifications
You must be signed in to change notification settings - Fork 0
/
sudokufile.h
51 lines (45 loc) · 1.06 KB
/
sudokufile.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
#ifndef SUDOKUDATA_H
#define SUDOKUDATA_H
#include "costanti.h"
#include "scacchiera.h"
#include "strategiadata.h"
#include <ostream>
#include <string>
#include <fstream>
using namespace std;
using namespace geometria;
struct SudokuData
{
char sudoku[X*Y];
int difficolta;
StrategiaData strategia;
};
std::ostream& operator<<(std::ostream& os, SudokuData& sudokudata);
class SudokuFile
{
private:
string f_name;
fstream f;
public:
SudokuFile (char* name);
~SudokuFile();
int n();
//write
void appendsudoku(Scacchiera scacchiera);
void appendsudoku(SudokuData sudokudata);
void appendsudoku(Scacchiera scacchiera, int difficolta);
void appendsudoku(char data[X*Y]);
void appendsudoku(char data[X*Y], int difficolta);
//read
char* read(int n);
char* pop();
//find
char* finddifficult(int n);
char* findstrategy(int strategy);
char* findstrategy(int strategy, int n);
//check
void deletepairs();
//order
void orderdifficult(const bool decrease=true);
};
#endif //SUDOKUDATA_H