标签:vat ret clone() shuff shuf new i++ clone int
/// <summary> /// 这是Knut重排算法的实现 /// </summary> /// <param name="number"></param> /// <returns></returns> private int[] ShuffeArray(int[] number) { int[] newArray = number.Clone() as int[]; for (int i = 0; i < newArray.Length; i++) { int tmp = newArray[i]; int r = Random.Range(i,newArray.Length); newArray[i] = newArray[r]; newArray[r] = tmp; } return newArray; }
标签:vat ret clone() shuff shuf new i++ clone int
原文地址:https://www.cnblogs.com/fengran/p/10442840.html