100
Recherche arborescente Monte-Carlo
int nbCoupsJoues ;
Intersection moves [MaxCoups ];
unsigned long long hash ;
unsigned long long HashHistory [MaxCoups ];
fl oat komi , score [2] ;
Go () {
}
komi = 7. 5;
hash = 0;
nbCoups Joues = 0;
for ( int i= 1; i <= Taille ; i++)
for ( i n t j = 1 ; j <= T a i 11 e ; j + +)
goban [i] [j ] =V ide ;
for (int i = O;
< Taille + 2; i++) {
}
goban [0] [i] = Exterieur ;
goban [i] [O] = Exterieur ;
goban [Taille + l] [i] = Exterieur ;
goban [ i] [Taille + 1] = Exterieur ;
void initHash () {
}
for ( in t c = 0; c < 2; c ++)
for (int i = l; i <= Taille ; i++)
for (int j = l; j <= Taille ; j++) {
HashArray [ c] [ i] [ j] = 0;
}
fo r (int b = O; b < 64; b++)
if (( rand () / (RAND_MAX + 1.0)) > 0.5)
HashArray [ c] [ i] [ j ] 1 = ( 1 ULL << b);
HashTurn = 0;
for (int j = O; j < 64; j++)
if ( (rand () / (RAND_MAX + 1. 0)) > 0. 5)
HashTurn I = ( 1 ULL << j);
bool coupLegal (Intersection inter , int couleur ) {
if ( ( inter . _x == 0) && ( inter . _y == 0))
return true ;
if (goban [inter ._x] [inter ._y] != Vide )
return false ;
for (int i = O; i < 4; i++) {
Intersection voisine = inter . voi si ne (i );
if (goban [voisine ._x] [voisine ._y] == Vide )
Recherche arborescente Monte-Carlo
int nbCoupsJoues ;
Intersection moves [MaxCoups ];
unsigned long long hash ;
unsigned long long HashHistory [MaxCoups ];
fl oat komi , score [2] ;
Go () {
}
komi = 7. 5;
hash = 0;
nbCoups Joues = 0;
for ( int i= 1; i <= Taille ; i++)
for ( i n t j = 1 ; j <= T a i 11 e ; j + +)
goban [i] [j ] =V ide ;
for (int i = O;
< Taille + 2; i++) {
}
goban [0] [i] = Exterieur ;
goban [i] [O] = Exterieur ;
goban [Taille + l] [i] = Exterieur ;
goban [ i] [Taille + 1] = Exterieur ;
void initHash () {
}
for ( in t c = 0; c < 2; c ++)
for (int i = l; i <= Taille ; i++)
for (int j = l; j <= Taille ; j++) {
HashArray [ c] [ i] [ j] = 0;
}
fo r (int b = O; b < 64; b++)
if (( rand () / (RAND_MAX + 1.0)) > 0.5)
HashArray [ c] [ i] [ j ] 1 = ( 1 ULL << b);
HashTurn = 0;
for (int j = O; j < 64; j++)
if ( (rand () / (RAND_MAX + 1. 0)) > 0. 5)
HashTurn I = ( 1 ULL << j);
bool coupLegal (Intersection inter , int couleur ) {
if ( ( inter . _x == 0) && ( inter . _y == 0))
return true ;
if (goban [inter ._x] [inter ._y] != Vide )
return false ;
for (int i = O; i < 4; i++) {
Intersection voisine = inter . voi si ne (i );
if (goban [voisine ._x] [voisine ._y] == Vide )
