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; } }
private void displayChoices(WordMeaning wm) { correctButtonIndex = rnd.Next(buttons.Length); currentWord = wm; displayRandomValueWhoAreNot(wm); questionLbl.Text = wm.Word; buttons[correctButtonIndex].Text = wm.Meaning; }