Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (Null.Answer == 0)
            {
                if (Null.Answer_Num == 10)
                {
                    Null.Score += 0;
                }
                else
                {
                    if (Null.Fifty == 10)
                    {
                        Null.Score += 5;
                    }
                    else
                    {
                        Null.Score += 10;
                    }
                }
            }
            else
            {
                if (Null.Fifty == 10)
                {
                    Null.Score += 5;
                }
                else
                {
                    Null.Score += 10;
                }
            }

            Null.Q         += 1;
            Null.ScoreTrue += 1;
            Form f = new Win();

            f.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        public void Check()
        {
            if (Null.Q != END)
            {
                if (Null.Answer == 1)
                {
                    Answer.Enabled = true;
                }
                else
                {
                    Answer.Enabled = false;
                }

                if (Null.Num == 0)
                {
                    fifty.Enabled = false;
                }
                else
                {
                    fifty.Enabled = true;
                }

                // Право на ошибку

                if (Null.Picture == 3)
                {
                    pictureBox1.Visible = true;
                    pictureBox2.Visible = true;
                    pictureBox3.Visible = true;

                    Null.Picture = 3;
                }
                else if (Null.Picture == 2)
                {
                    pictureBox1.Visible = true;
                    pictureBox2.Visible = true;
                    pictureBox3.Visible = false;

                    Null.Picture = 2;
                }
                else if (Null.Picture == 1)
                {
                    pictureBox1.Visible = true;
                    pictureBox2.Visible = false;
                    pictureBox3.Visible = false;

                    Null.Picture = 1;
                }
                else if (Null.Picture == 0)
                {
                    pictureBox1.Visible = false;
                    pictureBox2.Visible = false;
                    pictureBox3.Visible = false;

                    Null.Picture = 0;
                }

                //===============================================

                for (int vvI = number_mass; vvI < mass_not; vvI++)
                {
                    Answer_Text = massiv[vvI];

                    int first_pod  = 0;
                    int second_pod = 0;
                    int third_pod  = 0;
                    int fourth_pod = 0;
                    int fifth_pod  = 0;

                    int  test      = 1;
                    int  test_vvJ  = 0;
                    bool test_test = false;
                    int  testing   = 0;

                    for (int vvK = 0; test_test == false; vvK++)
                    {
                        if (Answer_Text.Substring(vvK, 1) == " ")
                        {
                            test_test = true;
                            testing   = vvK - 1;
                        }
                    }

                    for (int vvJ = 0; vvJ < Answer_Text.Length; vvJ++)
                    {
                        if (Answer_Text.Substring(vvJ, 1) == "_" && test == 1)
                        {
                            first_pod   = vvJ;
                            label5.Text = Answer_Text.Substring(0, vvJ) + "/" + END;
                            test_vvJ    = vvJ;
                            test++;
                            vvJ++;
                        }

                        if (Answer_Text.Substring(vvJ, 1) == "_" && test == 2)
                        {
                            first_pod   = vvJ;
                            label2.Text = Answer_Text.Substring(2, vvJ - 2);
                            test_vvJ    = vvJ;
                            test++;
                            vvJ++;
                        }

                        if (Answer_Text.Substring(vvJ, 1) == "_" && test == 3)
                        {
                            second_pod   = vvJ;
                            button1.Text = Answer_Text.Substring(test_vvJ + 1, second_pod - (first_pod + 1));
                            test_vvJ     = vvJ;
                            test++;
                            vvJ++;
                        }

                        if (Answer_Text.Substring(vvJ, 1) == "_" && test == 4)
                        {
                            third_pod    = vvJ;
                            button2.Text = Answer_Text.Substring(test_vvJ + 1, third_pod - (second_pod + 1));
                            test_vvJ     = vvJ;
                            test++;
                            vvJ++;
                        }

                        if (Answer_Text.Substring(vvJ, 1) == "_" && test == 5)
                        {
                            fourth_pod   = vvJ;
                            button3.Text = Answer_Text.Substring(test_vvJ + 1, fourth_pod - (third_pod + 1));
                            test_vvJ     = vvJ;
                            test++;
                            vvJ++;
                        }

                        if (Answer_Text.Substring(vvJ, 1) == "_" && test == 6)
                        {
                            fifth_pod    = vvJ;
                            button4.Text = Answer_Text.Substring(test_vvJ + 1, fifth_pod - (fourth_pod + 1));
                            test_vvJ     = vvJ;
                            test++;
                        }
                    }

                    button1.BackColor = Color.Gainsboro;
                    button2.BackColor = Color.Gainsboro;
                    button3.BackColor = Color.Gainsboro;
                    button4.BackColor = Color.Gainsboro;

                    button1.Visible = true;
                    button2.Visible = true;
                    button3.Visible = true;
                    button4.Visible = true;

                    Null.Q++;
                    label1.Text = "Вопрос №" + Convert.ToString(Null.Q);

                    Null.Score += 10;
                    label3.Text = "Очки:" + Null.Score;

                    Null.ScoreTrue++;

                    trueAnsw = Convert.ToInt32(Answer_Text.Substring(testing, 1));
                    number_mass++;
                    break;
                }
            }
            else
            {
                Null.Score += 10;

                this.Hide();
                Form f = new Win();
                f.Show();
            }
        }