1 #define TOTAL_SIZE 12 2 #define HALF_SIZE 6 3 #define START1 0 4 #define START2 6 5 #define END1 6 6 #define END2 12 7 #define PLAYER1 1 /* humain */ 8 #define PLAYER2 2 /* ordinateur */ 9 #define TRUE 1 10 #define FALSE 0 11 #define INFINI 50 12 #define ALLPIECES 48 13 #define DEFAULT_SEARCH 6 14 #define DEFAULT_FILENAME "awele.save" 15 16 /* nom du fichier de sauvegarde */ 17 extern char nomfich[80] ; 18 19 typedef struct { 20 char board[TOTAL_SIZE] ; /* l'echiquier */ 21 char p1 ; /* prisonniers fait par l'humain */ 22 char p2 ; /* prisonniers fait par la becane */ 23 } AWELE ; 24 25 typedef struct tree { 26 char prof ; /* nb de 1/2 coup depuis racine */ 27 char player ; /* joueur courant */ 28 char note ; /* note calculee */ 29 char best ; /* meilleur fils */ 30 AWELE *aw ; /* awele courant */ 31 struct tree *son[HALF_SIZE] ; 32 } TREE ; 33 34 /* move.c */ 35 void init_awele( AWELE * ) ; 36 int awele_play_hole( AWELE * , int ) ; 37 int check_possible_move( AWELE * , int , char ) ; 38 int play( int , AWELE * , char ) ; 39 40 /* util.c */ 41 char switch_player( char ) ; 42 void awele_equal( AWELE * , AWELE * ); 43 AWELE * create_awele( void ) ; 44 void destroy_awele( AWELE ** ) ; 45 TREE * create_tree( char , char , AWELE * ) ; 46 void destroy_tree( TREE ** ) ; 47 void awele2str( AWELE * , int , int , char * ) ; 48 void str2awele( char * , AWELE * , int * , int * ) ; 49 void str2level( char * , int * ) ; 50 void level2str( char * , int ) ; 51 52 /* alphabeta.c */ 53 void think( char , AWELE * , int , int * , int * ) ; 54 void randplay( AWELE * , int * , int * ) ; 55 56