5.9 Corrigés des exercices
return 0.0;
return sommeScore [ i] [ j] / nbPlayoutsCoup [ i] [ j];
}
}
int nbPlayouts ( int profondeur) {
int nb = O;
for ( int i = O; i <= Taille ; i ++)
for (int j = O; j <= Taille ; j++)
if (profondeur == 0)
nb += nbPlayoutsCoup [ i] [j ];
else if (fils [i] [j ] != NULL) {
115
n b += f i 1 s [ i ] [ j ] - > n b P 1 a y o u t s ( p ro fo n de u r - 1 ) ;
}
return nb ;
}
int nbPlayoutsFils ( int i, int j, int profondeur) {
i f ( p ro fo n de u r == 0)
}
return nbPlayoutsCoup [ i] [ j];
else if (fils [i] [j ] != NULL)
return fi ls [i] [j]->nbPlayouts (profondeur - l);
else
return nbPlayoutsCoup [ i] [j ];
void descente (Go & goban , int couleur );
} ;
const int TailleTable = 65535;
class Table {
public :
list t able [TailleTable + 1];
Noeud * presen t ( unsigned long long hash ) {
for ( list :: iterator iter =
}
table [ hash & TailleTable ]. begin ();
iter != table [hash & TailleTable ].end () ; iter++)
if ( ( * i te r )->ha s h == ha s h )
return * iter ;
return NULL ;
void aj oute (Noeud * n) {
table [n->hash & TailleTable ]. push_back (n);
}
Précédent

- 129/256

Suivant