1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119:
| 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 WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { string[] Array1 = {textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text, textBox11.Text, textBox12.Text, textBox13.Text, textBox14.Text, textBox15.Text, textBox16.Text, textBox17.Text, textBox18.Text, textBox19.Text, textBox20.Text, textBox21.Text, textBox22.Text, textBox23.Text, textBox24.Text, textBox25.Text, textBox26.Text, textBox27.Text, textBox28.Text, textBox29.Text, textBox30.Text, textBox31.Text, textBox32.Text, textBox33.Text, textBox34.Text, textBox35.Text, textBox36.Text, textBox37.Text, textBox38.Text, textBox39.Text, textBox40.Text, textBox41.Text, textBox42.Text, textBox43.Text, textBox44.Text, textBox45.Text, textBox46.Text, textBox47.Text, textBox48.Text, textBox49.Text, textBox50.Text, textBox51.Text, textBox52.Text, textBox53.Text, textBox54.Text, textBox55.Text, textBox56.Text, textBox57.Text, textBox58.Text, textBox59.Text, textBox60.Text, textBox61.Text, textBox62.Text, textBox63.Text, textBox64.Text, textBox65.Text, textBox66.Text, textBox67.Text, textBox68.Text, textBox69.Text, textBox70.Text, }; decimal[] Array2 = { numericUpDown1.Value, numericUpDown2.Value, numericUpDown3.Value, numericUpDown4.Value, numericUpDown5.Value, numericUpDown6.Value, numericUpDown7.Value, numericUpDown8.Value, numericUpDown9.Value, numericUpDown10.Value, numericUpDown11.Value, numericUpDown12.Value, numericUpDown13.Value, numericUpDown14.Value, numericUpDown15.Value, numericUpDown16.Value, numericUpDown17.Value, numericUpDown18.Value, numericUpDown19.Value, numericUpDown20.Value, numericUpDown21.Value, numericUpDown22.Value, numericUpDown23.Value, numericUpDown24.Value, numericUpDown25.Value, numericUpDown26.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, numericUpDown1.Value, };
Random Rnd=new Random(); int x; int y; int z; int w; int Stellenanzahl; string v; int a; string Spieler1; string Spieler2; string Gegner1; string Gegner2; decimal Stärke1; decimal Stärke2; decimal Stärke3; decimal Stärke4; int b; int c; int d; int f;
v = textBox71.Text; a = 0;
if (v == "") { MessageBox.Show("Bitte die Mitspieleranzahl in das Untere Dialogfeld eintragen!"); }
Stellenanzahl = Convert.ToInt32(v);
while (a != Stellenanzahl) { Reference2: x = Rnd.Next(0, Stellenanzahl); w = Rnd.Next(0, Stellenanzahl); y = Rnd.Next(0, Stellenanzahl); z = Rnd.Next(0, Stellenanzahl);
Stärke1 = Array2[x]; Stärke2 = Array2[y]; Stärke3 = Array2[w]; Stärke4 = Array2[z]; Spieler1=Array1[x]; Spieler2=Array1[y]; Gegner1=Array1[w]; Gegner2=Array1[z];
b = Convert.ToInt32(Stärke1); c = Convert.ToInt32(Stärke2); d = Convert.ToInt32(Stärke3); f = Convert.ToInt32(Stärke4);
if (b==c) { goto Reference1; } if (b == 0 || c == 0 || d == 0 || f == 0) { goto Reference1; }
goto Reference2; Reference1: if (b == d) { goto Reference3; } goto Reference1; Reference3: if (b == f) { goto Reference4; } goto Reference1; Reference4: if(a==0) { textBox72.Text = (Spieler1 + " und " + Spieler2 + " vs." + Gegner1 + " und " + Gegner2); } if (a == 1) { textBox73.Text = (Spieler1 + " und " + Spieler2 + " vs." + Gegner1 + " und " + Gegner2); } a = a + 1; }
} } } |