76
}
sortie << " .... ., .... ., ";
fo r (int i = O; i < Taille ; i++)
sortie << i <<
sortie << end! ;
Il
11 •
.... .. '
fo r (int i = O; i < Taille ; i++) {
sortie << i << " .... ., ";
for (int j = O; j < Taille ; j++)
sortie << v.damier
[j ] [i] «
sortie << end! ;
}
return sortie ;
Il
Il •
.... .. '
Recherche avec menaces
Phutball phutball ;
int main () {
list listeCoups ;
while ( true ) {
}
cout << phutball ;
IisteCoups . clear ();
if ( phutball . coupsLegaux (JoueurGauche , listeCoups )) {
cout << " j 'ai .__. gagne.... ., !" << end! ;
break ;
}
Coup coupAieatoire ;
int i = 0, indice = rand () % IisteCoups . size ();
for (list:: iterator it = listeCoups .begin ();
}
it != IisteCoups . end (); ++ it ) {
i f ( i == i n d i c e ) {
coupAieatoire = * i t;
break ;
}
i++;
cout << "Je .... ., joue.... ., en.... ., " << coupAieatoire << end! ;
phutball .joue (co upAleatoire );
cout << phutball ;
IisteCoups . clear ();
if ( phutball . coupsLegaux ( JoueurDroit , IisteCoups )) {
cout << "vous.... ., avez.... ., gagne.... ., !" << end! ;
break ;
}
Coup coup ;
cin >> coup ;
phutball . joue (coup );
}
sortie << " .... ., .... ., ";
fo r (int i = O; i < Taille ; i++)
sortie << i <<
sortie << end! ;
Il
11 •
.... .. '
fo r (int i = O; i < Taille ; i++) {
sortie << i << " .... ., ";
for (int j = O; j < Taille ; j++)
sortie << v.damier
[j ] [i] «
sortie << end! ;
}
return sortie ;
Il
Il •
.... .. '
Recherche avec menaces
Phutball phutball ;
int main () {
list
while ( true ) {
}
cout << phutball ;
IisteCoups . clear ();
if ( phutball . coupsLegaux (JoueurGauche , listeCoups )) {
cout << " j 'ai .__. gagne.... ., !" << end! ;
break ;
}
Coup coupAieatoire ;
int i = 0, indice = rand () % IisteCoups . size ();
for (list
}
it != IisteCoups . end (); ++ it ) {
i f ( i == i n d i c e ) {
coupAieatoire = * i t;
break ;
}
i++;
cout << "Je .... ., joue.... ., en.... ., " << coupAieatoire << end! ;
phutball .joue (co upAleatoire );
cout << phutball ;
IisteCoups . clear ();
if ( phutball . coupsLegaux ( JoueurDroit , IisteCoups )) {
cout << "vous.... ., avez.... ., gagne.... ., !" << end! ;
break ;
}
Coup coup ;
cin >> coup ;
phutball . joue (coup );
