Exemple #1
0
        private void buttonWylosuj_Click(object sender, EventArgs e)
        {
            // try-catch
            int zakresOd = int.Parse(textBoxZakresOd.Text);
            int zakresDo = int.Parse(textBoxZakresDo.Text);

            ResetGame();
            gameBox.Visible = true;
            g         = new Gra(zakresOd, zakresDo);
            countTime = new CountTime();
            countTime.startWatch(OnTimerTick);
        }
Exemple #2
0
 private void PickNumberBtn_Click(object sender, EventArgs e)
 {
     if (Int32.Parse(pickedNumberInp.Text) < aiGame.GetStartingNumber() || Int32.Parse(pickedNumberInp.Text) > aiGame.GetEndingNumber())
     {
         MessageBox.Show("Prosze wybrać numer z zakresu");
     }
     else
     {
         gameBox.Visible       = true;
         PickNumberBtn.Enabled = false;
         countTime             = new CountTime();
         countTime.startWatch(OnTimerTick);
         aiGame.PickedNumber    = Int32.Parse(pickedNumberInp.Text);
         pickedNumberLabel.Text = aiGame.PickFirstNumber().Value.ToString();
     }
 }