-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommun.h
More file actions
45 lines (31 loc) · 1.01 KB
/
commun.h
File metadata and controls
45 lines (31 loc) · 1.01 KB
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
#ifndef COMMUN
#define COMMUN
/*
tous les fichiers (interface graphique et moteur de jeu) ont besoin de ce header
il contient toutes les constantes et maccros de base indispensables a toute fonction
*/
#define SUCCESS 1
#define FAILURE 0
#define NB_PIECES 6
//eviter d'y toucher, sinon heuristique de IA.c ne va pas aimer
#define VIDE 0
#define PION 1
#define CAVALIER 2
#define FOU 3
#define TOUR 4
#define DAME 5
#define ROI 6
#define BLANC 1
#define NOIR -1
#define COTE_BLANC 7 //ie les pions blancs commencent en y = 6
#define COTE_NOIR 0 //les pions nooirs commencent en y = 1
#define NB_CASES_ECHIQUIER 64
#define NB_MAX_COUPS_POSSIBlES 218
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
/*
si l'echiquier est represente par un tableau 8x8, alors :
echiquier[0][0] represente a8, echiquier[0][1] represente b8, ...
echiquier[1][0] -> a7, echiquier[1][1] -> b7, ...
*/
#endif // COMMUN