C
C#11mo ago
Sehra

Random

Random.Shared.Next(int maxValue) you can use this to get a random number between 0 (inclusive) and maxValue (exclusive)
1 Reply
Sehra
SehraOP11mo ago
so if you have an array of items, you can do arr[Random.Shared.Next(arr.Length)] to get back a random item

Did you find this page helpful?