Ejemplo n.º 1
0
 private void btnInsertCoin2_Click(object sender, EventArgs e)
 {
     coinCode = Int32.Parse(txtCoinDoor.Text);
     if (activeCoins.IsActive(coinCode))
     {
         pedDoor.Open();
     }
     txtCoinDoor.Text = "";
 }
Ejemplo n.º 2
0
        public int DispenseCoin()
        {
            int number = r.Next(1, 10);

            while (coins.IsActive(number))
            {
                number = r.Next(1, 10);
            }
            coins.AddCoin(number);
            return(number);
        }