Как я могу изменить коды так, чтобы каждые два слота с одинаковым номером добавляли 10 монет, 30 монет для трех и 100 монет для 7 7 7.
В Microsoft Visual Studio 2010, спасибо
Что я уже пробовал:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Lucky_Seven { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void timer1_Tick(object sender, EventArgs e) { Random rnd = new Random(); lblSlot1.Text = Convert.ToString(rnd.Next(1, 8)); Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256)); lblSlot1.ForeColor = randomColor; } private void timer2_Tick(object sender, EventArgs e) { Random rnd = new Random(); lblSlot2.Text = Convert.ToString(rnd.Next(1, 8)); Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256)); lblSlot2.ForeColor = randomColor; } private void timer3_Tick(object sender, EventArgs e) { Random rnd = new Random(); lblSlot3.Text = Convert.ToString(rnd.Next(1, 8)); Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256)); lblSlot3.ForeColor = randomColor; } private void cmdPlay_Click(object sender, EventArgs e) { timer1.Enabled = true; timer2.Enabled = true; timer3.Enabled = true; cmdPlay.Enabled = false; cmdStop.Enabled = true; } private void cmdStop_Click(object sender, EventArgs e) { timer1.Enabled = false; timer2.Enabled = false; timer3.Enabled = false; cmdPlay.Enabled = true; cmdStop.Enabled = false; if (lblSlot1.Text == lblSlot2.Text) { int coins; coins = Convert.ToInt16(lblCoins.Text) + 10; lblCoins.Text = Convert.ToString(coins); } } private void cmdQuit_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Are you sure you want to quit?", "Lucky Seven", MessageBoxButtons.YesNo); switch (dr) { case DialogResult.Yes: Application.Exit(); break; case DialogResult.No: MessageBox.Show("Quitting applicationjcanceled","LuckySeven"); break; } } } }