示例#1
0
        // IEnumerable<T>
        public static List <T> Jumble <T>(this IEnumerable <T> collection, NoiseRand rand)
        {
            var result = collection.ToList();

            // Grab random elements from the collection and move them to the end
            for (int i = result.Count; i > 0; i--)
            {
                int index = rand.Next(i);
                result.Add(result[index]);
                result.RemoveAt(index);
            }
            return(result);
        }
示例#2
0
 public int get_rng(int max)
 {
     return(Rand.Next(max));
 }