Exemplo n.º 1
0
        public void Check()
        {
            int m = Convert.ToInt32(textBoxChN.Text);

            if (GameAlgorithm.Exercises(m, Level) == Convert.ToInt32(textBoxChR.Text))
            {
                Proverka++;
                if (Proverka == 1)
                {
                    Win();
                    Level++;
                    textBoxPrevNumX.Text     = "";
                    textBoxPrevNumY.Text     = "";
                    textBoxWrite.Text        = "";
                    tabControl.SelectedIndex = 1;
                    UnlockButton(LoginName);
                    Proverka = 0;
                }
                GetRandom();
            }
            else
            {
                textBoxChT.Text = Convert.ToString("Подумай");
                textBoxChN.Text = Convert.ToString("ещё!");
                MessageBox.Show("");
                textBoxChT.Text = Convert.ToString("Если Х=");
                textBoxChN.Text = Convert.ToString(m);
            }
        }
Exemplo n.º 2
0
 public void ReadAndWrit()
 {
     if (textBoxRead.Text != "")
     {
         textBoxWrite.Text = "";
         int a = Convert.ToInt32(textBoxRead.Text);
         int b = GameAlgorithm.Exercises(a, Level);
         textBoxWrite.Text += Convert.ToString(b);
         textBoxRead.Text   = "";
         if (NumCount < 8)
         {
             NumCount++;
             textBoxPrevNumX.Text += a + "\r\n";
             textBoxPrevNumY.Text += b + "\r\n";
         }
         else
         {
             NumCount = 0;
             NumCount++;
             textBoxPrevNumX.Text  = "";
             textBoxPrevNumY.Text  = "";
             textBoxPrevNumX.Text += a + "\r\n";
             textBoxPrevNumY.Text += b + "\r\n";
         }
     }
 }