C
C#3y ago
Hotz

Native method that returns multiple random values

Essentially, I am looking for a cleaner version of the following:
var foo = new float[] { rnd.Next(35), rnd.Next(35), rnd.Next(35) };
var foo = new float[] { rnd.Next(35), rnd.Next(35), rnd.Next(35) };
6 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
ero
ero3y ago
var foo =
Enumerable.Range(0, 3)
.Select(_ => Random.Shared.NextSingle(35))
.ToArray();
var foo =
Enumerable.Range(0, 3)
.Select(_ => Random.Shared.NextSingle(35))
.ToArray();
smileyface
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
ero
ero3y ago
neither would i
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Hotz
HotzOP3y ago
Ok, I'll keep this then. Thanks.
Want results from more Discord servers?
Add your server