Example #1
0
        private void displayRandomValueWhoAreNot(WordMeaning wm)
        {
            List<WordMeaning> values = new List<WordMeaning>();

            while (values.Count < buttons.Length)
            {
                WordMeaning v = null;
                while (v == null || v == wm || values.Contains(v))
                {
                    v = words[rnd.Next(words.Length)];
                }

                values.Add(v);
            }

            for (int i = 0; i < buttons.Length; i++)
            {
                buttons[i].Text = values[i].Meaning;
            }
        }
Example #2
0
        private void displayChoices(WordMeaning wm)
        {
            correctButtonIndex = rnd.Next(buttons.Length);
            currentWord = wm;

            displayRandomValueWhoAreNot(wm);

            questionLbl.Text = wm.Word;

            buttons[correctButtonIndex].Text = wm.Meaning;
        }