private void ResetBtn_Click(object sender, EventArgs e) { aiGame = new AiGame(null, null); countTime.stopWatch(); gameBox.Visible = false; finishBox.Visible = false; rangeLabel.Text = "Wybrany Zakres: " + aiGame.GetStartingNumber().ToString() + " - " + aiGame.GetEndingNumber().ToString(); PickNumberBtn.Enabled = true; }
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(); } }
public ComputerForm() { InitializeComponent(); aiGame = new AiGame(null, null); rangeLabel.Text = "Wybrany Zakres: " + aiGame.GetStartingNumber().ToString() + " - " + aiGame.GetEndingNumber().ToString(); }