I know how to do this in VB but im coding in C# so i need to figure out how to get two different radomized integers (1 - 8) and i cant seem to get it to work, i get the same over and over even more the harder i try. I have read up alot but i cant find a more specific help as most people just want one rnd number and that i can do...easy ;)
what i have coded is this thou it does not give me two different numbers.
public string GetFruitCombination()
{
Random fruitcombo = new Random();
int indexone = fruitcombo.Next(0, 8);
Random fruitcombotwo = new Random();
int indextwo = fruitcombotwo.Next(0, 8);
string firstfruit = m_fruit[indexone];
string secondfruit = m_fruit[indextwo];
return string.Format("{0}&{1}", firstfruit, secondfruit);
}
There must be an easier way to get 2 different rnd numbers right? So i need someone to push me in the right direction!
Thanks in advance for any idea and help!!!
//Regards