5.9 Corrigés des exercices
103
}
}
Vide ) {
dejavu2 . init ();
dejavu2 . marque (intersection );
st . push (in tersection );
while (! s t.e mpty ()) {
}
Intersection inter = st . top ();
s t. pop ();
for (int i = O; i < 4; i++) {
}
Intersection voisine = inter . voisine (i);
if (!dejavu2.marquee (voisine )) {
}
dejavu2 . marque (voisine );
if (goban [voisine ._x] [voisine ._y] -Vide ) {
}
compteur++;
if (compteur >= min )
return compteur ;
if (goban [voisine ._x] [voisine ._y] -- couleur )
st . push (voisine );
int adversaire = Noir ;
i f ( cou 1 eu r == Noir )
adversaire = Blanc ;
for (int i = O; i < 4; i++) {
}
Intersection voisine = intersection . voisine ( i );
if (goban [voisine ._x] [voisine ._y] == adversaire )
i f ( min Li b ( v o i s i n e , 2) == 1 ) {
}
compteur++;
if (compteur >= min )
return compteur ;
return compteur ;
void joue (In tersection inter , int couleur ) {
HashHistory [ nbCoupsJoues ] = hash ;
moves [nbCoupsJoues ] = inter ;
hash "= HashTurn ;
if ( i n ter . _x ! = 0) {
}
posePierre (inter , couleur );
enlevePrisonniers (inter , couleur );
103
}
}
Vide ) {
dejavu2 . init ();
dejavu2 . marque (intersection );
st . push (in tersection );
while (! s t.e mpty ()) {
}
Intersection inter = st . top ();
s t. pop ();
for (int i = O; i < 4; i++) {
}
Intersection voisine = inter . voisine (i);
if (!dejavu2.marquee (voisine )) {
}
dejavu2 . marque (voisine );
if (goban [voisine ._x] [voisine ._y] -Vide ) {
}
compteur++;
if (compteur >= min )
return compteur ;
if (goban [voisine ._x] [voisine ._y] -- couleur )
st . push (voisine );
int adversaire = Noir ;
i f ( cou 1 eu r == Noir )
adversaire = Blanc ;
for (int i = O; i < 4; i++) {
}
Intersection voisine = intersection . voisine ( i );
if (goban [voisine ._x] [voisine ._y] == adversaire )
i f ( min Li b ( v o i s i n e , 2) == 1 ) {
}
compteur++;
if (compteur >= min )
return compteur ;
return compteur ;
void joue (In tersection inter , int couleur ) {
HashHistory [ nbCoupsJoues ] = hash ;
moves [nbCoupsJoues ] = inter ;
hash "= HashTurn ;
if ( i n ter . _x ! = 0) {
}
posePierre (inter , couleur );
enlevePrisonniers (inter , couleur );
