0

How to choose a random number in c# ?

I need to know how to atribute a random value to an integer. Can you help me ?

18th Aug 2017, 5:11 PM
Hokome
Hokome - avatar
5 Answers
+ 4
using System; class Program { static void Main() { // ... Create new Random object. Random r = new Random(); // ... Get three random numbers. // Always 5, 6, 7, 8 or 9. Console.WriteLine(r. Next( 5, 10)); Console.WriteLine(r.Next(5, 10)); Console.WriteLine(r.Next(5, 10)); } }
18th Aug 2017, 5:57 PM
Given
Given - avatar
+ 3
yeah an instantiated prefab
18th Aug 2017, 6:32 PM
Given
Given - avatar
0
Ok thank you very much 😃
18th Aug 2017, 5:59 PM
Hokome
Hokome - avatar
0
is "Random" object a prefab ?
18th Aug 2017, 6:29 PM
Hokome
Hokome - avatar
0
Ok
18th Aug 2017, 6:32 PM
Hokome
Hokome - avatar