예제 #1
0
 public static void Shuffle(Pukes pukes)
 {
     for (int i = 0; i < pukes.pukes.Length; ++i)
     {
         int randomIndex = Random.Range(0, pukes.pukes.Length);
         pukes.Swap(i, randomIndex);
     }
 }
 public static void Shuffle(Pukes pukes)
 {
     for (int i = pukes.pukes.Length - 1; i >= 0; --i)
     {
         int randomIndex = Random.Range(0, i + 1);
         pukes.Swap(i, randomIndex);
     }
 }
예제 #3
0
        public static void Shuffle(Pukes pukes)
        {
            int len = pukes.pukes.Length;

            for (int i = 0; i < len; ++i)
            {
                int randomIndex = Random.Range(0, i + 1);
                pukes.Swap(i, randomIndex);
            }
        }