Esempio n. 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);
        }
Esempio n. 2
0
 public Rng()
 {
     Rand = new NoiseRand();
 }