11.5 Corrigés des exercices
}
if ( ! moreThanOneMove (ta bu ) )
tabu = 9;
for (inti= O; i < MaxSize * MaxSize; i++)
if (( color [ i] != 9) && ( color [ i] != tabu ))
if (seen .test (i)) {
}
buildMove ( i , se en , moves [ nbMoves ]);
if (moves [nbMoves ]. nbLocations > 1)
nbMoves++;
if (nbMoves == 0) {
}
for (int i = O;
< MaxSize * MaxSize; i++)
if (color [i] != 9)
if (seen. test (i)) {
}
buildMove ( i , seen , moves [ nbMoves ]);
if (moves [nbMoves ]. nbLocations > 1)
nbMoves++;
void remove (int !oc ) {
}
while (!oc > MaxSize - 1) {
}
color [!oc ] = color [!oc
MaxSize ];
!oc = !oc
MaxSize;
color [!oc ] = 9;
void removeColumn (in t column ) {
}
for (int row = O; row < MaxSize; row++ ) {
}
for ( int i = column; i < MaxSize - 1; i ++ ) {
color [row * MaxSize + i] =
col or [row * MaxSize + i + 1];
}
color [row * MaxSize + MaxSize - 1) = 9;
void playMove (Move & move ) {
Il on do i t tr ier pour enlever
Il les cases du haut en premier
move . sort () ;
for (int i = O; i < move. nbLocations; i++) {
rem ove ( move. 1 oc a t ions [ i ]) ;
}
199
Précédent

- 213/256

Suivant