Exemplo n.º 1
0
        private void SetupQuiz()
        {
            numQ1.Value = 0; numQ2.Value = 0;
            numQ3.Value = 0; numQ4.Value = 0;

            quiz1 = new Quiz(RandomNumber(-10, 10), RandomNumber(-5, 5), "+");
            quiz2 = new Quiz(RandomNumber(-10, 10), RandomNumber(-5, 5), "-");
            quiz3 = new Quiz(RandomNumber(-10, 10), RandomNumber(-5, 5), "*");
            while (true)
            {
                int arg2 = RandomNumber(-5, 5);
                if (arg2 != 0)
                {
                    quiz4 = new Quiz(RandomNumber(-10, 10), arg2, "/");
                    break;
                }
            }


            lblQ1.Text = quiz1.ToString();
            lblQ2.Text = quiz2.ToString();
            lblQ3.Text = quiz3.ToString();
            lblQ4.Text = quiz4.ToString();

            timeLeft           = 60;
            lblTimer.Text      = String.Format("Pozostały czas: {0}sek.", timeLeft);
            lblTimer.ForeColor = Color.Black;

            btnStart.Text = "START";
        }
Exemplo n.º 2
0
        public void setupQuiz()
        {
            quiz1 = new Quiz(RandomNumber(-10, 10), RandomNumber(-10, 10), "+");
            quiz2 = new Quiz(RandomNumber(-10, 10), RandomNumber(-10, 10), "-");
            quiz3 = new Quiz(RandomNumber(-10, 10), RandomNumber(-10, 10), "*");
            quiz4 = new Quiz(RandomNumber(-10, 10), RandomNumber(-10, 10), "/");

            lblQ1.Text = quiz1.ToString();
            lblQ2.Text = quiz2.ToString();
            lblQ3.Text = quiz3.ToString();
            lblQ4.Text = quiz4.ToString();

            numQ1.Value = 0; numQ1.Minimum = Int32.MinValue; numQ1.Maximum = Int32.MaxValue;
            numQ2.Value = 0; numQ2.Minimum = Int32.MinValue; numQ2.Maximum = Int32.MaxValue;
            numQ3.Value = 0; numQ3.Minimum = Int32.MinValue; numQ3.Maximum = Int32.MaxValue;
            numQ4.Value = 0; numQ4.Minimum = Int32.MinValue; numQ4.Maximum = Int32.MaxValue;

            timeLeft           = 60;
            lblTimer.Text      = String.Format("Pozostały czas: {0}sek.", timeLeft);
            lblTimer.ForeColor = Color.Black;

            btnStart.Text = "START";
        }