-
Notifications
You must be signed in to change notification settings - Fork 0
/
Solver.h
70 lines (42 loc) · 1.19 KB
/
Solver.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
68
69
#include <stdio.h>
#include <iostream>
#include "Cellule.h"
using namespace std;
class Solver {
private:
int **grille;
Cellule **ligne;
Cellule **col;
int *val_lignes;
int *val_colonnes;
int nb_lignes;
int nb_colonnes;
int *val_possibles;
int nb_val_possibles;
public:
void generer(int nbL, int nbC);
static int nb_tentatives;
static int nb_iteration;
static int nb_solution;
static int MAX_SOLUTION;
Solver(int *val_lignes, int *val_colonnes, int *val_possibles, int nb_lignes, int nb_colonnes,
int nb_val_possibles);
Solver(const Solver &a);
Solver();
void creerKakuro(int nbL, int nbC, int num_val_possibles);
void print_grid();
int sumRow(int i);
int sumCol(int i);
bool check_val_row(int i);
bool check_val_col(int i);
bool end_of_game();
void monte_carlo();
void solve(int m);
bool choose(int x, int y, bool opti);
bool solve_monte_carlo(bool opti);
void reinitialiser();
int nb_val_possible(int i, int j);
int *possible_choice(int cpt, int i, int j);
void delete_choice(int x, int i, int j);
void forward_checking(Solver k, int i, int j);
};