public static void Suffle <T> (this T[] array, int amount) { int count = array.Length; T tempValue; for (int i = 0; i < amount; i++) { var index1 = EiRandom.Range(count); var index2 = EiRandom.Range(count); tempValue = array [index1]; array [index1] = array [index2]; array [index2] = tempValue; } }
public EiRandomizedQueue(IEnumerable <T> items) { random = new EiRandom(EiRandom.Range(0, 1000000)); content.AddRange(items); }
public EiRandomizedQueue() { random = new EiRandom(EiRandom.Range(0, 1000000)); }
public static float Randomness(this float value, float amount) { return(value + EiRandom.Range(-amount, amount)); }
public static int Randomness(this int value, int amount) { return(value + EiRandom.Range(-amount, amount)); }
public static double Randomness(this double value, double amount) { return(value + EiRandom.Range(-amount, amount)); }