This language bar is your friend. Select your favorite languages!
Select your favorite languages :
- Or search :
Random rng = new Random(DateTime.Now.Day);
Random takes an Int as an input; the description is too vague to understand what is meant by "current date time" this implementation only uses the day. See the DateTime Documentation (https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=netframework-4.8) for more and provide your own implementation.
srand(time());
While this is correct, the PHP Manual entry for srand() states: "There is no need to seed the random number generator with srand() or mt_srand() as this is done automatically."
rand = random.Random()
the constructor uses the current time if used without arguments.
you could also use the functions of the random module (they are using a shared ``Random`` object which is constructed the first time random is imported
you could also use the functions of the random module (they are using a shared ``Random`` object which is constructed the first time random is imported