This repository has been archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
initialisation.h
67 lines (56 loc) · 1.61 KB
/
initialisation.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
#ifndef INITIALISATION_H
#define INITIALISATION_H
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <iostream>
#include <functional>
#include "solution.h"
#include "digit.h"
/**
* initialisation class
* \n this class is used to generate a sudoku using the backtracking
* \n solution algorithm with empty grid.
*
* Example:
* @code
* #include "initialisation.h"
*
* void main() {
* int**grid;
* initialisation init(60);
* grid=init.exec();
* }
*/
class initialisation
{
private:
///The playable sudoku grid
digit**grid;
///numbers of deleted digits from the grid, difficulty
int remove_number_from_grid;
///This method is used to fill the grid with unassigned.
void generate_empty();
///This method is used to remove random digits in the grid.
void remove_numbers();
///This method sets all the unassigned digits to changeble, they can be modified
void set_changeble();
public:
/// This constructor is used for creating a double array for the sudoku.
/**
* @param remove_number_from_grid How many digits you want to set to UNASSIGNED
* \n to remove from the sudoku in order to provide different difficulties.
*/
initialisation(int remove_number_from_grid);
/// This Operator is used for creating a playeble grid
/**
* @return a solveble and fully playeble grid(sudoku)
*/
digit** operator()();
/// This method changes all the changeble digits to unnasigned.
/**
* \n Its used to remove users faults for the solver to work properly
* \n @param grid is the a double array you want to change
*/
void set_changeble_dig_to_null(digit**&grid);
};
#endif