static void Main(string[] args) { //random number gen Console.WriteLine("Array Random Number:"); randomGenA(); Console.WriteLine("------------------"); //LIST: random movie picker... Console.WriteLine("List Random Number:"); randomGenB(); Console.WriteLine("------------------"); Console.ReadLine(); } static void randomGenA() { Random randomA = new Random(); int randomNumA = randomA.Next(51); Console.WriteLine(randomNumA); } static void randomGenB() { Random randomB = new Random(); int randomNumB = randomB.Next(0,51); Console.WriteLine(randomNum); } } I wanted them both to produce two different random numbers but instead I keep getting the same random number from both of them. Why does it do this?
Randomobjects is minimal, causing them to have the same seed. Introduce a delay (please don't) or share theRandominstance.Random randomB = new Random();in class and use it in both methods.