コード例 #1
0
ファイル: RandomSelection.cs プロジェクト: suzuke/C5
        // 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);
            }
        }
コード例 #2
0
        public string RandomHexStr()
        {
            C5Random rdm      = getRandom2;
            string   hexValue = string.Empty;
            int      num;

            num      = rdm.Next(8, 101);
            hexValue = num.ToString("X2");
            return(hexValue);
        }
コード例 #3
0
 public static Point Random(int w, int h)
 {
     return(new Point(rnd.Next(w), rnd.Next(h)));
 }
コード例 #4
0
ファイル: ClusterMonitor.cs プロジェクト: lulzzz/kino
 private TimeSpan RandomizeClusterAutoDiscoveryStartDelay()
 => routeDiscoveryConfig.ClusterAutoDiscoveryStartDelay
 .MultiplyBy(randomizer.Next(1, routeDiscoveryConfig.ClusterAutoDiscoveryStartDelayMaxMultiplier));
コード例 #5
0
ファイル: GConvexHull.cs プロジェクト: younne0915/C5
 public static Point Random(int w, int h) => new Point(rnd.Next(w), rnd.Next(h));