Exemple #1
0
        private bool wordsExistThaGameartWith(String word)
        {
            int    maxLength = 35;
            string longest   = word;

            for (int i = 0; i < maxLength; i++)
            {
                longest += "*";
                if (Game.PartialMatch(longest).Count > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            listView1.Items.Clear();
            string  longest = result.Text;
            Boolean check   = true;

            foreach (DictionaryEntry de in Game.PartialMatch(longest, '?'))
            {
                check = false;
                string[] row = { de.Key.ToString() };
                listView1.Items.Add(new ListViewItem(row));
            }
            if (check)
            {
                MessageBox.Show("This word doesn't exist in the dictionary");
            }
        }
Exemple #3
0
        private String findLongestWord(String word, int length)
        {
            int    maxLength = 35;
            string longest   = word;

            for (int i = 0; i < length; i++)
            {
                longest += "*";
            }
            for (int i = length; i < maxLength; i++)
            {
                longest += "*";
                foreach (DictionaryEntry de in Game.PartialMatch(longest))
                {
                    return(de.Key.ToString());
                }
            }
            return("");
        }