2.14 Corrigés des exercices
43
}
if ( depth == 0)
return quiescence (alpha , beta , joueur );
list listeCoups = virus . coupsLegaux (joueur );
if (listeCoups .empty ())
return virus . evaluationSiPlusDeCoupsPossibles (joueur );
listeCoups . sort ();
char autre = virus . adversaire (joueur );
fo r ( list :: iterator it = listeCoups . begin ();
}
i t ! = 1 i s te C o u p s . end () ; ++ i t ) {
virus . joue (* it );
1 i s t vptemp ;
int eval = -alphabeta ( depth - 1, -beta , -alpha , autre ,
vptemp );
if (eval >a lpha) {
alpha = eval ;
vp = vptemp ;
vp . push_front (* it );
}
virus . dejoue (* it );
if (alpha >= be ta ) {
}
scoreHistorique [it ->nombre ()] += 4 << (depth * 2);
return beta ;
return alpha ;
int approfondissementlteratif ( list & vp ) {
int eval = virus . evaluation ( 'O' );
1 i s t vpTemp ;
clockStart = clock ();
initHistorique ();
fo r (int d = 1;
}
( clock () - clockStart < maxClock ) &&
( d < ProfondeurMax );
d++) {
int evalTemp = alphabeta (d , -Taille * Taille , Taille *
Taille , 'O' , vpTemp );
if (clock ()
clockStart < maxClock ) {
eval = evalTemp ;
vp = vpTemp ;
}
return eval ;
Précédent

- 57/256

Suivant