-
Notifications
You must be signed in to change notification settings - Fork 0
/
MorSo.c
65 lines (63 loc) · 1.17 KB
/
MorSo.c
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
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include "Basic_Fct.h"
#include "NRPA.h"
int main(int argc, char** argv)
{
int i;
//
// fichier texte de sortie
//
FILE* fichier;
fichier = fopen("c:/users/MS/toto_recurs.txt","w");
//
// declaration des grilles de jeu
//
grille Node, Init, Max;
//
// declaration et init de la stratégie
//
poli strat;
for (i = 0; i < MAXGRI*MAXGRI*4; i++)
strat.policy[i] = 0;
//
// source alea
//
srand(89765);
//
// niveau de jeu
//
int NIV;
NIV = init_jeu(&Init);
//
// grille initiale
//
memcpy(&Node, &Init, sizeof(grille));
rech_coup(&Node);
//
// boucle principale de jeu
//
Max.nbhc = 0;
while(Node.nbcoup > 0)
{
Max=NRPA(2,&Node,strat,fichier);
fprintf(fichier, "fin recurs level=2 n=3\n");
fclose(fichier);
exit(66);
NIV++;
printf("%d %d %010d\n", NIV, Max.nbhc, sign_grille(&Max));
Node=constr_jeu(&Max, &Init, NIV,fichier);
rech_coup(&Node);
fprintf(fichier,"Grille Max\n");
disp_jeu(&Max, fichier);
NRPA_disp_pol(strat, fichier);
}
//
// sortie des resultats
//
disp_jeu(&Max, fichier);
NRPA_disp_pol(strat, fichier);
}