Пример #1
0
        //méthode de vérification des contraintes
        static bool verifContraintes(Plateau plateau, string mot)
        {
            //Initialisation pour les contraintes
            Dictionnaire mondico = CreationDico();
            int          debut   = 0;
            int          fin     = mondico.EnsembleMot.Length;

            string[] tabTrie = mondico.triArray(); //tri le tableau contenant tout les mots du dico alphabétiquement

            List <List <int[]> > listePositionsGlobal    = plateau.ListePositionsGlobal(mot);
            List <int[]>         listePositionsUtilisees = new List <int[]>();

            //WriteAt("Vérification ....patientez svp....",0,11);


            //pour aller au plus vite et ne pas chercher 10 secondes un mot d'une lettre, containtes dans ordre croissant de temps pris
            if (mot.Length >= 3)//si longueur ok
            {
                bool verifAdjacence = plateau.Test_Plateau(mot, listePositionsGlobal, listePositionsUtilisees);
                if (verifAdjacence == true) //si adjacence ok
                {
                    bool verifDico = mondico.RechDichoRecursif(debut, fin, mot, tabTrie);
                    if (verifDico == true) //si appartient au dico
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Пример #2
0
        ///méthode création instance dico
        static Dictionnaire CreationDico()
        {
            string langue = "Français";

            string[]     ensembleMots = ReadFile(OpenFile("MotsPossibles.txt"));
            Dictionnaire mondico      = new Dictionnaire(ensembleMots, langue);

            return(mondico);
        }