82
}
}
Recherche avec menaces
}
for ( int i= -1; i <= 1; i++)
fo r (int j = -1; j <= 1; j++) {
Intersection inter = *it;
}
i n t e r . x += i ;
i n t e r . y += j ;
if (inter . legale ())
i f ( damier [ i n te r . x ] [ i n te r . y ] == ' + ' ) {
i f ( ( ( j o u e u r == Jo u e u r D ro i t ) &&
(inte r.X < meilleur)) Il
}
((joueur == JoueurGauche ) &&
(inter .X > meilleur )))
meilleur = inter .x;
for ( list : : iterator it = liste . begin ();
it != liste .end (); ++ it ) {
}
if (damier [it- >x ] [it- >y ] == '+ ')
if (it ->x == meilleurB alle ) {
Coup coup ;
}
coup.l.push_back (* Ît );
aj outeCoup (coup , listeCoups );
for ( i n t i = - 1 ; i <= 1 ; i + +)
f o r ( i n t j = - 1 ; j <= 1 ; j + +) {
Intersection inter = * it ;
}
i n ter . x += i ;
i n t e r . y += j ;
if (in ter . legale ())
i f ( damier [ i n t e r . x ] [ i n t e r . y ] -- ' + ' )
if ( i n ter . x == me i 11 eu r ) {
Coup coup ;
}
coup . 1. push_back (in ter );
aj outeCoup (coup , listeCoups );
La modification de la recherche À est minime puisqu'il suffit d'ajouter l'ordre du coup
pour les coups Max :
bool lambda ( int joueur , int ordre ) {
if ( phutball . gagne (joueur , phutball . balle ))
return true ;
list listeCoups , listeCoupsAdverses ;
if ( phutball . coupsLegaux (0 , joueur , listeCoups ))
Précédent

- 96/256

Suivant