private void buttonchargementalea2_Click(object sender, RoutedEventArgs e)
        {
            if (textBchargementalea.Text != "")
            {
                donnerentrer = int.Parse(textBchargementalea.Text);
            }


            deplacer_gauche(grid1, 232, 0.5); grid5.Visibility = Visibility.Hidden;
            menuutiliser = 1;
            BitmapImage src = new BitmapImage();

            src.BeginInit();
            src.UriSource = new Uri("arrows-1.png", UriKind.Relative);
            src.EndInit();
            img.Source  = src;
            img.Stretch = Stretch.UniformToFill;
            affichermenubutton.Content = stackPnl;
            chargementdjafait          = 1;


            mat = new Matrice(int.Parse(textBchargementalea2.Text), int.Parse(textBchargementalea.Text), x, y);
            mat.chargement(princcanvas, comPrincipal);

            chargementdjafait            = 1;
            chargmentalealiste.IsEnabled = false;
            buttoninsertion.IsEnabled    = true;
            okrecherche.IsEnabled        = true;
        }
        private void textBchargementalea_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                deplacer_gauche(grid1, 232, 0.5); grid5.Visibility = Visibility.Hidden; menuutiliser = 1;
                BitmapImage src = new BitmapImage();
                src.BeginInit();
                src.UriSource = new Uri("arrows-1.png", UriKind.Relative);
                src.EndInit();
                img.Source  = src;
                img.Stretch = Stretch.UniformToFill;
                affichermenubutton.Content = stackPnl;

                if ((int.Parse(textBchargementalea.Text) > 5) || (int.Parse(textBchargementalea2.Text) > 5))
                {
                    erreur.Text   = "Entrer une valeur entre 1 et 5 ";
                    erreur.CoordX = 350;
                    erreur.CoordY = 358;
                    erreur.apparaitre(0.5);
                    erreur.disparaitre(3.9);
                    textBchargementalea.Text = "";
                }
                else
                {
                    mat = new Matrice(int.Parse(textBchargementalea2.Text), int.Parse(textBchargementalea.Text), x, y);
                    mat.chargementAleatoir(comPrincipal, princcanvas);
                    mat.afficher(princcanvas);
                    chargementdjafait            = 1;
                    chargmentalealiste.IsEnabled = false;
                    buttoninsertion.IsEnabled    = true;
                    okrecherche.IsEnabled        = true;
                }
            }
        }
        private async void textBchargementalea2P_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                deplacer_gauche(grid1, 232, 0.5); grid4.Visibility = Visibility.Hidden;
                menuutiliser = 1;
                BitmapImage src = new BitmapImage();
                src.BeginInit();
                src.UriSource = new Uri("arrows-1.png", UriKind.Relative);
                src.EndInit();
                img.Source  = src;
                img.Stretch = Stretch.UniformToFill;
                affichermenubutton.Content = stackPnl;
                chargementdjafait          = 1;
                if (algoutiliser == 0)
                {
                    deplacer_gauche(gridalgo, 311, .7);
                }
                algoutiliser = 1;

                if ((int.Parse(textBchargement2p.Text) > 5) || (int.Parse(textBchargementaleap.Text) > 5))
                {
                    erreur.Text   = "Entrer une valeur entre 1 et 5 ";
                    erreur.CoordX = 350;
                    erreur.CoordY = 358;
                    erreur.apparaitre(0.5);
                    erreur.disparaitre(3.9);
                    textBchargementalea.Text = "";
                }
                else
                {
                    try { mat2.masquer(princcanvas); }
                    catch { }

                    try { produit.masquer(princcanvas); }
                    catch { }

                    affichermenubutton.IsEnabled = false;
                    mat2 = new Matrice(int.Parse(textBchargement2p.Text), int.Parse(textBchargementaleap.Text), x + (mat.NbColonnes + 1) * 50, y);
                    mat2.chargementAleatoir(comPrincipal, princcanvas);
                    mat2.afficher(princcanvas);
                    if (mat.NbColonnes == mat2.NbLignes)
                    {
                        produit = new Matrice(mat.NbLignes, mat2.NbColonnes, x + 50 * (mat.NbColonnes + 1), y);
                    }
                    int a = int.Parse(textBchargement2p.Text);
                    if (a < int.Parse(textBchargementaleap.Text))
                    {
                        a = int.Parse(textBchargementaleap.Text);
                    }
                    await Matrice.produit(mat, mat2, produit, princcanvas, x + (mat.NbColonnes + 1) * 50 / 2, y + 50 *(a + 1) + 25, comPrincipal, algocanvas);

                    affichermenubutton.IsEnabled = true;

                    chargmentalealiste.IsEnabled = false;
                }
            }
        }
        private async void okrecherche_Click(object sender, RoutedEventArgs e)
        {
            BitmapImage src1 = new BitmapImage();

            src1.BeginInit();
            BitmapImage src2 = new BitmapImage();

            src2.BeginInit();
            // if (textboxrecherche.Text != "") { donnerentrer = int.Parse(textboxrecherche.Text); }
            if (algoutiliser == 0)
            {
                deplacer_gauche(gridalgo, 311, .7);
            }
            BitmapImage src = new BitmapImage();

            src.BeginInit();
            src.UriSource = new Uri("arrows-1.png", UriKind.Relative);
            src.EndInit();
            img.Source  = src;
            img.Stretch = Stretch.UniformToFill;
            affichermenubutton.Content = stackPnl;
            algoutiliser = 1;
            deplacer_gauche(grid1, 232, 0.3); grid2.Visibility = Visibility.Hidden; menuutiliser = 1;


            try { mat2.masquer(princcanvas); }
            catch { }

            try { det.masquer(princcanvas); }
            catch { }

            try { transposée.masquer(princcanvas); }
            catch { }

            try { produit.masquer(princcanvas); }
            catch { }

            try
            {
                affichermenubutton.IsEnabled = false;
                transposée = new Matrice(mat.NbColonnes, mat.NbLignes, x + 50 * (mat.NbColonnes + 1), y);
                await mat.trans(x + 50 *(mat.NbColonnes + 1), y, princcanvas, comPrincipal, transposée, algocanvas);

                affichermenubutton.IsEnabled = true;
            }
            catch { }
        }
Beispiel #5
0
        private async void sarus(Case det, Canvas c, Commentaire comPrincipal, Canvas Algo) //Déterminant par la méthode de Sarus
        {
            Algo algo = new Algo(30, coordX_Algo, coordY_Algo);                             //Affichage de l'étape en cours dans l'algo

            algo.afficher(Algo);
            comPrincipal.Text        = "Calcul de déterminant d'une matrice 3x3\npar la méthode de Sarus...";
            comPrincipal.CouleurFond = couleurComPrincipal;
            comPrincipal.apparaitre(0);
            Commentaire[] com = new Commentaire[8];
            await algo.colorer(couleurAlgo, 0, Temps.time);

            for (int i = 0; i < 3; i++)     //Affichage des commentaires d'illustration
            {
                com[i] = new Commentaire("c" + (i + 1), Brushes.Black, coordX + (i + 0.25) * widthOfcase, coordY - 30, 25, 25, couleurCom, couleurCom);
                com[i].ajouterCanvas(c);
                com[i].apparaitre(Temps.time);
                await Task.Delay(TimeSpan.FromSeconds(Temps.time));
            }
            Matrice plus = new Matrice(nbLignes, nbColonnes + 2, coordX + (nbColonnes + 1) * widthOfcase, coordY); //Création d'une matrice 3x5 contentant

            for (int i = 0; i < plus.nbLignes; i++)                                                                //les colonnes c1, c2, c3, c1, c2
            {
                for (int j = 0; j < nbColonnes + 2; j++)
                {
                    plus.tab[i, j] = new Case(tab[i, j % nbColonnes].Valeur, plus.coordX + j * widthOfcase, plus.coordY + i * heightOfcase, 1, heightOfcase, widthOfcase, couleurFondCase, couleurBordureCase, 1);
                }
            }
            plus.afficher(c);
            await Task.Delay(TimeSpan.FromSeconds(Temps.time)); //Affichage des commentaires d'illustration

            for (int i = 0; i < 3; i++)
            {
                com[i + 3] = new Commentaire("c" + (i + 1), Brushes.Black, plus.coordX + (i + 0.25) * widthOfcase, plus.coordY - 30, 25, 25, couleurCom, couleurCom);
                com[i + 3].ajouterCanvas(c);
                com[i + 3].apparaitre(Temps.time);
                await Task.Delay(TimeSpan.FromSeconds(Temps.time));
            }
            for (int i = 0; i < 2; i++)
            {
                com[i + 6] = new Commentaire("c" + (i + 1), Brushes.Black, plus.coordX + (i + 3 + 0.25) * widthOfcase, plus.coordY - 30, 25, 25, Brushes.LightPink, Brushes.White);
                com[i + 6].ajouterCanvas(c);
                com[i + 6].apparaitre(Temps.time);
                await Task.Delay(TimeSpan.FromSeconds(Temps.time));
            }
            TextBlock textBlock = new TextBlock();      //Textblock pour affichier l'opération en cours

            textBlock.FontFamily = new FontFamily("Poiret One");
            textBlock.Foreground = Brushes.Blue;
            Canvas.SetLeft(textBlock, coordX);
            Canvas.SetTop(textBlock, plus.coordY + (nbLignes + 1) * heightOfcase);
            c.Children.Add(textBlock);
            await Task.Delay(TimeSpan.FromSeconds(Temps.time));

            int b = 1;

            for (int i = 0; i < 3; i++)     //Parcours des diagonales de gauche à droite (sens positif)
            {
                int j;
                b = 1;
                await algo.colorer(couleurAlgo, 1, 0.5 *Temps.time);        //Affichage de l'étape en cours dans l'algo

                await algo.colorer(couleurAlgo, 2, 0.5 *Temps.time);

                for (j = 0; j < 3; j++)
                {
                    plus.tab[j, j + i].BackgroundColor = couleurSelection;
                }
                await Task.Delay(TimeSpan.FromSeconds(Temps.time));

                for (j = 0; j < 3; j++)     //Cases de la diagonale
                {
                    await algo.colorer(couleurAlgo, 3, 0.5 *Temps.time);

                    plus.tab[j, j + i].clignoter(couleurClignottement, plus.couleurBordureCase, plus.tab[j, j + i].BorderThick, 2); //clignottement de la case
                    textBlock.FontSize = 15;                                                                                        //Et affichage de l'opération dans le textBlock
                    if (j != 0 && j != 2)
                    {
                        textBlock.Text += " x " + plus.tab[j, j + i].Valeur.ToString();
                    }
                    else if (j != 0 && j == 2)
                    {
                        textBlock.Text += " x " + plus.tab[j, j + i].Valeur.ToString() + ")";
                    }
                    else if (i != 0)
                    {
                        textBlock.Text += plus.tab[j, j + i].Valeur.ToString();
                    }
                    else if (i == 0)
                    {
                        textBlock.Text = "(" + plus.tab[j, j + i].Valeur.ToString();
                    }
                    await algo.colorer(couleurAlgo, 4, Temps.time);     //étape en cours dans l'algo

                    if (i != 2 && j == 2)
                    {
                        textBlock.Text += " + (";
                    }
                    plus.tab[j, j + i].colorChamp(couleurSelection, plus.couleurBordureCase, 1);
                    b = b * plus.tab[j, j + i].Valeur;
                    await algo.colorer(couleurAlgo, 5, 0.5 *Temps.time);
                }
                for (j = 0; j < 3; j++)
                {
                    plus.tab[j, j + i].BackgroundColor = couleurFondCase;
                }
                await algo.colorer(couleurAlgo, 6, 0.5 *Temps.time);

                det.Valeur += b;
                await algo.colorer(couleurAlgo, 7, 0.5 *Temps.time);
            }
            for (int i = 4; i > 1; i--)                              //Parcours des diagonales de droite à gauche (sens négatif)
            {
                await algo.colorer(couleurAlgo, 8, 0.5 *Temps.time); //Étapes de l'algo en cours

                await algo.colorer(couleurAlgo, 9, 0.5 *Temps.time);

                int j;
                b = 1;
                for (j = 0; j < 3; j++)
                {
                    plus.tab[j, i - j].BackgroundColor = couleurSelection;      //illustration avec couleurs
                }
                textBlock.Text += " - (";
                await Task.Delay(TimeSpan.FromSeconds(Temps.time));

                for (j = 0; j < 3; j++)                                   //Parcours des cases de la diagonale
                {
                    await algo.colorer(couleurAlgo, 10, 0.5 *Temps.time); //Affichage de l'étape en cours dans l'algo

                    plus.tab[j, i - j].clignoter(couleurClignottement, plus.couleurBordureCase, plus.tab[j, i - j].BorderThick, 2);
                    textBlock.FontSize = 15;
                    if (j != 0 && j != 2)
                    {
                        textBlock.Text += " x " + plus.tab[j, i - j].Valeur.ToString();
                    }
                    else if (j != 0 && j == 2)
                    {
                        textBlock.Text += " x " + plus.tab[j, i - j].Valeur.ToString() + ")";
                    }
                    else
                    {
                        textBlock.Text += /*" - (" +*/ plus.tab[j, i - j].Valeur.ToString();
                    }
                    await algo.colorer(couleurAlgo, 11, Temps.time);

                    plus.tab[j, i - j].colorChamp(couleurSelection, plus.couleurBordureCase, 1);
                    b = b * plus.tab[j, i - j].Valeur;
                    await algo.colorer(couleurAlgo, 12, 0.5 *Temps.time);
                }
                for (j = 0; j < 3; j++)
                {
                    plus.tab[j, i - j].BackgroundColor = couleurFondCase;
                }
                await algo.colorer(couleurAlgo, 13, 0.5 *Temps.time);

                await algo.colorer(couleurAlgo, 14, 0.5 *Temps.time);

                det.Valeur -= b;
            }
            det.Height        = heightOfcase * 0.5; //Mise en forme de la case contenant le déterminant
            det.Width         = widthOfcase * 2;
            det.CoordX        = coordX + 3 * widthOfcase;
            det.CoordY        = plus.coordY + (nbLignes + 1) * heightOfcase;
            det.Forme.Opacity = 0;
            det.afficher(c);
            textBlock.Text = "";
            Point[] tabPoint = new Point[1];
            tabPoint[0] = new Point(coordX + widthOfcase / 2, coordY + (nbLignes + 0.5) * heightOfcase);
            await det.appear(tabPoint, 1);          //Affichage du déterminant sous la matrice

            await Task.Delay(50);

            det.Forme.Opacity = 1;
            det.clignoter(Brushes.LightSkyBlue, Brushes.White, 1, 2);
            for (int i = 0; i < 8; i++)
            {
                com[i].disparaitre(Temps.time);
            }
            await Task.Delay(TimeSpan.FromSeconds(Temps.time));

            for (int i = 0; i < 8; i++)
            {
                com[i].enleverCanvas(c);
            }
            comPrincipal.Text = "Le déterminant de la matrice est " + det.Valeur;
            await Task.Delay(TimeSpan.FromSeconds(Temps.time));

            plus.masquer(c);
            await algo.colorer(couleurAlgo, 15, 0.5 *Temps.time);

            algo.disparaitre(Algo);
        }
Beispiel #6
0
        public async Task trans(double x, double y, Canvas c, Commentaire comPrincipal, Matrice transposée, Canvas Algo)        //Transposée d'une matrice
        {
            Algo algo = new Algo(29, coordX_Algo, coordY_Algo);

            algo.afficher(Algo);
            Commentaire com1 = new Commentaire("Matrice de type\n" + nbLignes + " x " + nbColonnes.ToString(), Brushes.Black, coordX, coordY - 60, 210, 50, couleurCom, Brushes.White);

            comPrincipal.Text        = "Transposition d'une matrice";
            comPrincipal.CouleurFond = couleurComPrincipal;
            comPrincipal.apparaitre(0);
            com1.ajouterCanvas(c);
            com1.apparaitre(Temps.time);
            await Task.Delay(TimeSpan.FromSeconds(Temps.time));

            Commentaire com2 = new Commentaire("Matrice transposée de type\n" + nbColonnes.ToString() + " x " + nbLignes.ToString(), Brushes.Black, x + nbLignes * widthOfcase + 30, y + heightOfcase, 150, 50, couleurCom, Brushes.White);

            com2.ajouterCanvas(c);
            com2.apparaitre(Temps.time);
            await algo.colorer(couleurAlgo, 0, 0.5 *Temps.time);

            Matrice squelette = new Matrice(nbColonnes, nbLignes, x, y);        //Création d'un corps de la matrice transposée

            for (int i = 0; i < nbColonnes; i++)
            {
                for (int j = 0; j < nbLignes; j++)
                {
                    squelette.tab[i, j] = new Case(0, x + j * widthOfcase, y + i * heightOfcase, 1, heightOfcase, widthOfcase, couleurFondCase, couleurBordureCase, 1);
                    squelette.tab[i, j].TextBLock.Opacity = 0;
                }
            }
            squelette.afficher(c);
            await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));

            com1.disparaitre(Temps.time);
            com2.disparaitre(Temps.time);
            Point[] tabPoint = new Point[1];
            for (int i = 0; i < nbLignes; i++)
            {
                await algo.colorer(couleurAlgo, 1, 0.5 *Temps.time);        //Affichage de l'étape dans l'algo

                if (i != 0)
                {
                    com1.Text = (i + 1).ToString() + "ème ligne";       //Explication de l'étape dans les commentaires
                    com2.Text = (i + 1).ToString() + "ème colonne";
                }
                else
                {
                    com1.Text = (i + 1).ToString() + "ère ligne";
                    com2.Text = (i + 1).ToString() + "ère colonne";
                }
                com1.CoordX = coordX - 100;
                com1.CoordY = coordY + 50 * i + 5;
                com1.Height = 40;
                com1.Width  = 80;
                com1.apparaitre(Temps.time);
                com2.CoordX = x + 50 * i - 20;
                com2.CoordY = y - 50;
                com2.Height = 40;
                com2.Width  = 90;
                com2.apparaitre(Temps.time);
                for (int j = 0; j < nbColonnes; j++)
                {
                    tab[i, j].colorChamp(couleurSelection, couleurBordureCase, 1);                                      //Les lignes la matrice sont les colonnes de la matrice transposée
                }
                for (int j = 0; j < nbColonnes; j++)
                {
                    squelette.tab[j, i].colorChamp(couleurSelection, couleurBordureCase, 1);
                }
                await Task.Delay(TimeSpan.FromSeconds(Temps.time));

                for (int j = 0; j < nbColonnes; j++)
                {
                    await algo.colorer(couleurAlgo, 2, 0.5 *Temps.time);

                    await algo.colorer(couleurAlgo, 3, 0.5 *Temps.time);

                    //await Task.Delay(50);
                    transposée.tab[j, i] = new Case(tab[i, j].Valeur, coordX + j * widthOfcase, coordY + i * heightOfcase, 1, heightOfcase, widthOfcase, couleurFondCase, couleurBordureCase, 1);
                    transposée.tab[j, i].Forme.Opacity = 0;
                    transposée.tab[j, i].afficher(c);
                    tab[i, j].clignoter(couleurClignottement, couleurBordureCase, 1, 2);        //Déplacement de chaque élément de la ligne de la matrice
                    tabPoint[0] = new Point(x + i * widthOfcase, y + j * heightOfcase);         //Vers la colonne de la transposée
                    await transposée.tab[j, i].appear(tabPoint, 1);
                    await Task.Delay(50);

                    transposée.tab[j, i].Forme.Opacity = 1;
                    tab[i, j].colorChamp(couleurSelection, couleurBordureCase, 1);
                    await algo.colorer(couleurAlgo, 4, 0.5 *Temps.time);
                }
                for (int j = 0; j < nbColonnes; j++)
                {
                    tab[i, j].colorChamp(couleurFondCase, couleurBordureCase, 1);
                }
                for (int j = 0; j < nbColonnes; j++)
                {
                    squelette.tab[j, i].colorChamp(couleurFondCase, couleurBordureCase, 1);
                }
                await algo.colorer(couleurAlgo, 5, 0.5 *Temps.time);
            }
            await algo.colorer(couleurAlgo, 6, 0.5 *Temps.time);

            com1.disparaitre(Temps.time);
            com2.disparaitre(Temps.time);
            squelette.masquer(c);
            await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));

            comPrincipal.Text = "Transposition de la matrice réussie !";
            algo.disparaitre(Algo);
        }
Beispiel #7
0
        public async static Task produit(Matrice matA, Matrice matB, Matrice produit, Canvas c, double x, double y, Commentaire comPrincipal, Canvas Algo)
        /* Produit matriciel de la matrice A x la matrice B, et rangement du résultat dans la matrice Produit*/
        {
            Algo        algo = new Algo(28, coordX_Algo, coordY_Algo);
            Commentaire com1 = new Commentaire("Nombre de colonnes de la première\nmatrice: " + matA.nbColonnes.ToString(), Brushes.Black, matA.coordX, matA.coordY - 60, 210, 50, couleurCom, Brushes.White);
            Commentaire com2 = new Commentaire("Nombre de lignes de la deuxieme\nmatrice: " + matB.nbLignes.ToString(), Brushes.Black, matB.coordX + matB.nbColonnes * widthOfcase + 20, matB.coordY + 50, 210, 50, couleurCom, Brushes.White);

            comPrincipal.Text        = "Produit matriciel"; //Animation de la comparaison entre le nombre de colonnes de la matrice A et le nombre de lignes de la matrice B
            comPrincipal.CouleurFond = couleurComPrincipal;
            comPrincipal.apparaitre(0);
            com1.ajouterCanvas(c);
            com1.apparaitre(Temps.time);
            com2.ajouterCanvas(c);
            com2.apparaitre(Temps.time);
            await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));

            com1.disparaitre(Temps.time);
            com2.disparaitre(Temps.time);
            if (matA.nbColonnes == matB.nbLignes)
            {
                algo.afficher(Algo);                                 //Affichage de l'algorithme
                await algo.colorer(couleurAlgo, 0, 0.5 *Temps.time); //Indication de l'étape en cours dans l'algo

                produit.nbLignes         = matA.nbLignes;
                produit.nbColonnes       = matB.nbColonnes;
                produit.coordX           = x;
                produit.coordY           = y;
                produit.tab              = new Case[matA.nbLignes, matB.nbColonnes]; //Initialisation de la matrice produit
                comPrincipal.Width       = 250;
                comPrincipal.Text        = "Nombre de lignes = Nombre de colonnes\nProduit matriciel en cours...";
                comPrincipal.CouleurFond = couleurComPrincipal;
                await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));

                com1.Text   = "Nombre de lignes de la première\nmatrice: " + matA.NbLignes.ToString();      //Récupération du nombre de lignes de la matrice A et du nombre de colonnes de la matrice B
                com1.CoordX = matA.coordX - 220;                                                            //Pour la création de la matrice produit
                com1.CoordY = matA.coordY + 50;
                com1.apparaitre(Temps.time);
                com2.Text   = "Nombre de colonnes de la deuxième\nmatrice: " + matA.NbLignes.ToString();
                com2.CoordX = matB.coordX;
                com2.CoordY = matB.coordY - 60;
                com2.apparaitre(Temps.time);
                await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));

                Commentaire com3 = new Commentaire("Matrice produit de type\n" + matA.nbLignes.ToString() + " x " + matB.nbColonnes.ToString(), Brushes.Black, x - 180, y + heightOfcase, 150, 50, couleurCom, Brushes.White);
                com3.ajouterCanvas(c);
                com3.apparaitre(Temps.time);
                Matrice squelette = new Matrice(matA.nbLignes, matB.nbColonnes, x, y);
                for (int i = 0; i < matA.nbLignes; i++)     //Création d'un corps vide pour la matrice produit
                {
                    for (int j = 0; j < matB.nbColonnes; j++)
                    {
                        squelette.tab[i, j] = new Case(0, x + j * widthOfcase, y + i * heightOfcase, 1, heightOfcase, widthOfcase, matA.couleurFondCase, couleurClignottement, 1);
                        squelette.tab[i, j].TextBLock.Opacity = 0;
                    }
                }
                squelette.afficher(c);
                await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));

                TextBlock textBlock = new TextBlock();      //textBlock pour afficher l'oépration en cours (multiplications)
                textBlock.FontFamily = new FontFamily("Poiret One");
                textBlock.Foreground = Brushes.Blue;
                Canvas.SetLeft(textBlock, x /*+ (matB.nbColonnes + 1) * widthOfcase /2*/);
                Canvas.SetTop(textBlock, y - 50);
                c.Children.Add(textBlock);

                Point[] tabPoint = new Point[1];
                for (int i = 0; i < matA.nbLignes; i++)
                {
                    await algo.colorer(couleurAlgo, 1, 0.5 *Temps.time);        //Affichage de l'étape n cours dans l'algo

                    if (i != 0)
                    {
                        com1.Text = (i + 1).ToString() + "ème ligne";           //Explication de l'étape en commentaire
                    }
                    else
                    {
                        com1.Text = (i + 1).ToString() + "ère ligne";
                    }
                    com1.CoordX = matA.coordX - 100;
                    com1.CoordY = matA.coordY + 50 * i + 5;
                    com1.Height = 40;
                    com1.Width  = 80;
                    com1.apparaitre(Temps.time);
                    for (int p = 0; p < matA.nbColonnes; p++)
                    {
                        matA.tab[i, p].BackgroundColor = couleurSelection;                                          //Sélection de la ligne de la matrice A
                    }
                    for (int j = 0; j < matB.nbColonnes; j++)
                    {
                        if (j != 0)
                        {
                            com2.Text = (j + 1).ToString() + "ème colonne";
                        }
                        else
                        {
                            com2.Text = (j + 1).ToString() + "ère colonne";
                        }
                        com2.CoordX = matB.coordX + 50 * j - 20;
                        com2.CoordY = matB.coordY - 50;
                        com2.Height = 40;
                        com2.Width  = 90;
                        com2.apparaitre(Temps.time);
                        for (int p = 0; p < matB.nbLignes; p++)
                        {
                            matB.tab[p, j].BackgroundColor = couleurSelection;      //Sélection de la colonne de la matrice B
                        }
                        await algo.colorer(couleurAlgo, 2, 0.5 *Temps.time);        //Affichag de l'étape en cours dans l'algo

                        await algo.colorer(couleurAlgo, 3, 0.5 *Temps.time);

                        int a = 0;
                        await Task.Delay(TimeSpan.FromSeconds(Temps.time));

                        for (int k = 0; k < matA.nbColonnes; k++)       //Produit matriciel
                        {
                            await algo.colorer(couleurAlgo, 4, 0.5 *Temps.time);

                            await algo.colorer(couleurAlgo, 5, 0.5 *Temps.time);

                            //await Task.Delay(50);
                            matA.tab[i, k].clignoter(couleurClignottement, matA.couleurBordureCase, matA.tab[i, k].BorderThick, 2);     //clignottement des cases à multiplier
                            matB.tab[k, j].clignoter(couleurClignottement, matB.couleurBordureCase, matB.tab[k, j].BorderThick, 2);
                            textBlock.FontSize = 15;
                            if (k != 0)
                            {
                                textBlock.Text += " + " + matA.tab[i, k].Valeur.ToString() + " x " + matB.tab[k, j].Valeur.ToString();
                            }
                            else
                            {
                                textBlock.Text = matA.tab[i, k].Valeur.ToString() + " x " + matB.tab[k, j].Valeur.ToString();         //Affichage de l'opération dans le textBlock
                            }
                            a += matA.tab[i, k].Valeur * matB.tab[k, j].Valeur;
                            await Task.Delay(TimeSpan.FromSeconds(Temps.time));

                            matA.tab[i, k].colorChamp(couleurSelection, matA.couleurBordureCase, 1);
                            matB.tab[k, j].colorChamp(couleurSelection, matB.couleurBordureCase, 1);
                            await algo.colorer(couleurAlgo, 6, 0.5 *Temps.time);
                        }
                        produit.tab[i, j] = new Case(a, x, y - heightOfcase / 2, 1, heightOfcase, widthOfcase, matA.couleurFondCase, couleurClignottement, 1);
                        produit.tab[i, j].Forme.Opacity = 0;
                        produit.tab[i, j].afficher(c);
                        textBlock.Text = "";
                        tabPoint[0]    = new Point(x + j * widthOfcase, y + i * heightOfcase);
                        await produit.tab[i, j].appear(tabPoint, 1);        //calcul du résultat et déplacement dans la matrice produit
                        await Task.Delay(50);

                        produit.tab[i, j].Forme.Opacity = 1;
                        for (int p = 0; p < matB.nbLignes; p++)
                        {
                            matB.tab[p, j].colorChamp(matB.couleurFondCase, matB.couleurBordureCase, 1);
                        }
                        await algo.colorer(couleurAlgo, 7, 0.5 *Temps.time);
                    }
                    for (int p = 0; p < matA.nbColonnes; p++)
                    {
                        matA.tab[i, p].colorChamp(matA.couleurFondCase, matA.couleurBordureCase, 1);
                    }
                    await algo.colorer(couleurAlgo, 8, 0.5 *Temps.time);
                }
                com1.disparaitre(Temps.time);
                com2.disparaitre(Temps.time);
                com3.disparaitre(Temps.time);
                squelette.masquer(c);
                comPrincipal.Text        = "Produit effectué avec succès !";
                comPrincipal.CouleurFond = couleurComPrincipal;
                for (int i = 0; i < produit.nbLignes; i++)
                {
                    for (int j = 0; j < produit.nbColonnes; j++)
                    {
                        produit.tab[i, j].BorderColor = matA.couleurBordureCase;
                    }
                }
                await algo.colorer(couleurAlgo, 9, 0.5 *Temps.time);

                algo.disparaitre(Algo);
            }
            else
            {
                comPrincipal.CouleurFond = Brushes.Red;         //Commentaire d'échec de produit
                comPrincipal.Text        = "Impossible de faire le produit\nLe nombre de colonnes de la première matrice\nest différent du nombre de lignes de la 2ème";
                await Task.Delay(TimeSpan.FromSeconds(Temps.time * 2));
            }
        }