-
-
Save themartorana/c744a9cc0fdcd02521e0 to your computer and use it in GitHub Desktop.
Flyclops Domino! Bone Randomization Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // for Unity (C#) | |
| public static void Shuffle<T>(this List<T> list) | |
| { | |
| System.Random rnd = new System.Random(); | |
| int n = list.Count; | |
| while (n > 1) { | |
| n--; | |
| int k = rnd.Next(n + 1); | |
| T obj = list[k]; | |
| list[k] = list[n]; | |
| list[n] = obj; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How is this used to manipulate the dominoes