Exemplo n.º 1
0
        private void RandomizeButtons()
        {
            buttons.Clear();

            List <ExpressionAnswer> expression_answers = Enum.GetValues(typeof(ExpressionAnswer)).Cast <ExpressionAnswer>().ToList();

            while (expression_answers.Count > 0)
            {
                int              num    = rng.Next(expression_answers.Count);
                Button           button = button_list[buttons.Count];
                ExpressionAnswer answer = expression_answers[num];
                expression_answers.RemoveAt(num);
                buttons.Add(button, answer);
            }
            ChangeButtonsLanguage(chosen_language);
        }
Exemplo n.º 2
0
        private void answer_button_Click(object sender, EventArgs e)
        {
            Button           button = (Button)sender;
            ExpressionAnswer answer = buttons[button];

            if (current_expression.Answer(answer))
            {
                ++correct_answers;
            }
            else
            {
                ++wrong_answers;
            }

            UpdateLabels();
            StartShowingImage();
        }
Exemplo n.º 3
0
 public bool Answer(ExpressionAnswer answer)
 {
     return(answer == CorrectAnswer);
 }