let generer_plateau_solution ~n ~m ~c () =
let mon_plateau = {n = n; m = m; c = c; p = (Array.create_matrix m n None); v = false} in
let nouvelle_piece_sous_contrainte ~i ~j ~pl () =
let (b, g, h, d) = ( (ref (couleur_random ~c:c ())), (ref (couleur_random ~c:c ())), (ref (couleur_random ~c:c ())), (ref (couleur_random ~c:c ())) ) in
if (i > 0) then
actualise_couleur g "gauche" pl.(i-1).(j);
if (j > 0) then
actualise_couleur b "bas" pl.(i).(j-1);
if (i < m-1) then
actualise_couleur d "droite" pl.(i+1).(j);
if (j < n-1) then
actualise_couleur h "haut" pl.(i).(j+1);
{b = !b; g = !g; d = !d; h = !h};
in
for ii = 0 to (m - 1) do
for jj = 0 to (n - 1) do
mon_plateau.p.(ii).(jj) <- Some (nouvelle_piece_sous_contrainte ~i:ii ~j:jj ~pl:(mon_plateau.p) () );
done;
done;
mon_plateau