private int left;
private int middle;
private int right;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Random r = new Random();
left = r.Next(1, 4);
middle = r.Next(1, 4);
right = r.Next(1, 4);
while (left == middle)
{
left = r.Next(1, 4);
middle = r.Next(1, 4);
}
while (left == right)
{
left = r.Next(1, 4);
right = r.Next(1, 4);
}
while (middle == left)
{
middle = r.Next(1, 4);
left = r.Next(1, 4);
}
while (middle == right)
{
middle = r.Next(1, 4);
right = r.Next(1, 4);
}
while (right == left)
{
right = r.Next(1, 4);
left = r.Next(1, 4);
}
while(right == middle)
{
right = r.Next(1, 4);
middle = r.Next(1, 4);
}
}
so far this is what i have, but i don't want the three variables to have the same number, i thought the while loops would fix that but it didn't. I'm still new to c# does anyone have any suggestions?
whileparts) I got1,2,2. Do you mean you want all three values to be different?