1.This is what i've got this so far
2.Its suppposed to randomize the numbers on the buttons when it starts. But it still generates duplicates (and i dont want duplicates).
I use Visual studio 2012 C# for this
Its only supposed to do it once i startup the program. So its a one time randomize
Random rand = new Random(); int RandomOne = rand.Next(0, 10); int RandomTwo = rand.Next(0, 10); int RandomThree = rand.Next(0, 10); int RandomFour = rand.Next(0, 10); int RandomFive = rand.Next(0, 10); int RandomSix = rand.Next(0, 10); int RandomSeven = rand.Next(0, 10); int RandomEight = rand.Next(0, 10); int RandomNine = rand.Next(0, 10); int RandomZero = rand.Next(0, 10); btnOneNgra.Text = Convert.ToString(RandomOne); if ((RandomTwo == RandomOne) || (RandomTwo == RandomNine) || (RandomTwo == RandomThree) || (RandomTwo == RandomFour) || (RandomTwo == RandomFive) || (RandomTwo == RandomSix) || (RandomTwo == RandomSeven) || (RandomTwo == RandomEight) || (RandomTwo == RandomZero)) { RandomTwo = rand.Next(0, 10); } else { btnTwoNgra.Text = Convert.ToString(RandomTwo); } if ((RandomThree == RandomOne) || (RandomThree == RandomTwo) || (RandomThree == RandomNine) || (RandomThree == RandomFour) || (RandomThree == RandomFive) || (RandomThree == RandomSix) || (RandomThree == RandomSeven) || (RandomThree == RandomEight) || (RandomThree == RandomZero)) { RandomThree = rand.Next(0, 10); } else { btnThreeNgra.Text = Convert.ToString(RandomThree); } if ((RandomFour == RandomOne) || (RandomFour == RandomTwo) || (RandomFour == RandomThree) || (RandomFour == RandomNine) || (RandomFour == RandomFive) || (RandomFour == RandomSix) || (RandomFour == RandomSeven) || (RandomFour == RandomEight) || (RandomFour == RandomZero)) { RandomFour = rand.Next(0, 10); } else { btnFourNgra.Text = Convert.ToString(RandomFour); } if ((RandomFive == RandomOne) || (RandomFive == RandomTwo) || (RandomFive == RandomThree) || (RandomFive == RandomFour) || (RandomFive == RandomNine) || (RandomFive == RandomSix) || (RandomFive == RandomSeven) || (RandomFive == RandomEight) || (RandomFive == RandomZero)) { RandomFive = rand.Next(0, 10); } else { btnFiveNgra.Text = Convert.ToString(RandomFive); } if ((RandomSix == RandomOne) || (RandomSix == RandomTwo) || (RandomSix == RandomThree) || (RandomSix == RandomFour) || (RandomSix == RandomFive) || (RandomSix == RandomNine) || (RandomSix == RandomSeven) || (RandomSix == RandomEight) || (RandomSix == RandomZero)) { RandomSix = rand.Next(0, 10); } else { btnSixNgra.Text = Convert.ToString(RandomSix); } if ((RandomSeven == RandomOne) || (RandomSeven == RandomTwo) || (RandomSeven == RandomThree) || (RandomSeven == RandomFour) || (RandomSeven == RandomFive) || (RandomSeven == RandomSix) || (RandomSeven == RandomNine) || (RandomSeven == RandomEight) || (RandomSeven == RandomZero)) { RandomSeven = rand.Next(0, 10); } else { btnSevenNgra.Text = Convert.ToString(RandomSeven); } if ((RandomEight == RandomOne) || (RandomEight == RandomTwo) || (RandomEight == RandomThree) || (RandomEight == RandomFour) || (RandomEight == RandomFive) || (RandomEight == RandomSix) || (RandomEight == RandomSeven) || (RandomEight == RandomNine) || (RandomEight == RandomZero)) { RandomEight = rand.Next(0, 10); } else { btnEightNgra.Text = Convert.ToString(RandomEight); } if ((RandomNine == RandomOne) || (RandomNine == RandomTwo) || (RandomNine == RandomThree) || (RandomNine == RandomFour) || (RandomNine == RandomFive) || (RandomNine == RandomSix) || (RandomNine == RandomSeven) || (RandomNine == RandomEight) || (RandomNine == RandomZero)) { RandomNine = rand.Next(0, 10); } else { btnNineNgra.Text = Convert.ToString(RandomNine); } if ((RandomZero == RandomOne) || (RandomZero == RandomTwo) || (RandomZero == RandomThree) || (RandomZero == RandomFour) || (RandomZero == RandomFive) || (RandomZero == RandomSix) || (RandomZero == RandomSeven) || (RandomZero == RandomEight) || (RandomZero == RandomNine)) { RandomZero = rand.Next(0, 10); } else { btnZeroNgra.Text = Convert.ToString(RandomZero); }