-
Notifications
You must be signed in to change notification settings - Fork 29
/
main.cpp
37 lines (28 loc) · 844 Bytes
/
main.cpp
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
#include "sudokuGen.hpp"
using namespace std;
// START: The main function
int main(int argc, char const *argv[])
{
// Initialising seed for random number generation
srand(time(NULL));
// Creating an instance of Sudoku
Sudoku *puzzle = new Sudoku();
// Creating a seed for puzzle generation
puzzle->createSeed();
// Generating the puzzle
puzzle->genPuzzle();
// Calculating difficulty of puzzle
puzzle->calculateDifficulty();
// testing by printing the grid
puzzle->printGrid();
// Printing the grid into SVG file
string rem = "sudokuGen";
string path = argv[0];
path = path.substr(0,path.size() - rem.size());
puzzle->printSVG(path);
cout<<"The above sudoku puzzle has been stored in puzzles.svg in current folder\n";
// freeing the memory
delete puzzle;
return 0;
}
// END: The main function