// Select N random items from coll, with replacement. // Does not modify the given list. public static SCG.IEnumerable <T> RandomWith <T>(IIndexed <T> coll, int N) { for (int i = N; i > 0; i--) { T x = coll[rnd.Next(coll.Count)]; yield return(x); } }
public string RandomHexStr() { C5Random rdm = getRandom2; string hexValue = string.Empty; int num; num = rdm.Next(8, 101); hexValue = num.ToString("X2"); return(hexValue); }
public static Point Random(int w, int h) { return(new Point(rnd.Next(w), rnd.Next(h))); }
private TimeSpan RandomizeClusterAutoDiscoveryStartDelay() => routeDiscoveryConfig.ClusterAutoDiscoveryStartDelay .MultiplyBy(randomizer.Next(1, routeDiscoveryConfig.ClusterAutoDiscoveryStartDelayMaxMultiplier));
public static Point Random(int w, int h) => new Point(rnd.Next(w), rnd.Next(h));