Random in C# is not working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ahubb343

Whenever I try to use Random.Randi() etc I get an error: Random does not contain a definition Randi. Since no one else seems to be having this problem I’m assuming it is a problem with me. Can someone please tell me how I’m supposed to use Random this is driving me insane.

Nevermind I figured it out. If anyone else has this problem what I did was instead of using the Random.Randi() like the documentation says I created a new Random object, and called called the Next() method from it. Like this:

Random rnd1 = new Random();
num = (rnd1.Next() % 10);

I also updated my .NET framework from here. Not sure if that was what fixed it though.

ahubb343 | 2018-02-25 18:46