Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Head breaker
Message
De
02/07/2019 19:55:10
 
 
À
02/07/2019 18:50:50
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01669346
Message ID:
01669352
Vues:
50
>>I'm trying to write code that will generate valid English words from an array of seven letters.
>>
>>string[] letters = new string[] { "g", "a", "u", "n", "t", "l", "e", "t' };
>>
>>I found a dictionary that gives valid results when testing to see if a word is valid.
>>(See checkit, below)
>
>Each letter can only be used once?
>

You can use a letter more than once.

>>I don't want words with fewer than 5 characters.
>>The word must contain (anywhere) the first letter in the array
>>I want to write the valid words to a text file.
>>
>>I think that the word generation can be done recursively but I've been getting nowhere.
>>
>>Any ideas?
>>
>>Pseudo code would be fine.
>>
>>
>>
>>
>>
>>
>>
>>
>>public void CheckIt(string wordToCheck, string[] letters)
>>        {
>>
>>            if (wordToCheck.Length >= 5)
>>            {
>>                if (wordToCheck.Contains(letters[0]))
>>                {
>>
>>                    bool wordfound = false;
>>                    NetSpell.SpellChecker.Spelling oSpell = new NetSpell.SpellChecker.Spelling();
>>
>>                    oSpell.Dictionary = oDict;
>>                    if (oSpell.TestWord(wordToCheck))
>>                    {
>>                        //It is in dictionary
>>                        wordfound = true;
>>                        Textout.WriteLine(wordToCheck);
>>
>>                    }
>>
>>                }
>>            }
>>        }
>>
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform