Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random r = new Random();
- private void button11_Click(object sender, EventArgs e)
- {
- int agg;
- int h1, h2, a1, a2;
- textBox1.Clear();
- for (int i = 1; i <= 20; i++) //48-40-20-20
- {
- do
- {
- agg = r.Next(0, 3);
- h1 = agg == 0 ? r.Next(0, 5) : r.Next(0, 9);
- h2 = agg == 0 ? r.Next(0, 5) : r.Next(0, 9);
- a1 = agg == 0 ? h1 : r.Next(0, 9);
- a2 = agg == 0 ? h2 : r.Next(0, 9);
- } while (agg == 0 ? (h1 + a2) == (h2 + a1) : (agg == 1 ? (h1 + a2) >= (h2 + a1) : (h1 + a2) <= (h2 + a1)));
- textBox1.Text += $"{i}. " + (agg == 1 && (h1 + a2) == (h2 + a1) ? $"{h1}:{a1}, {h2}:{a1}H" : (agg == 2 && (h1 + a2) == (h2 + a1) ? $"{h1}:{a1}, {h2}:{a1}A" : $"{h1}:{a1}, {h2}:{a1}")) + Environment.NewLine;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement