Skip to content

Instantly share code, notes, and snippets.

@themartorana
Forked from jakeobrien/gist:5503948
Last active December 25, 2025 13:56
Show Gist options
  • Select an option

  • Save themartorana/c744a9cc0fdcd02521e0 to your computer and use it in GitHub Desktop.

Select an option

Save themartorana/c744a9cc0fdcd02521e0 to your computer and use it in GitHub Desktop.
Flyclops Domino! Bone Randomization Code
// 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;
}
}
@themartorana

Copy link
Copy Markdown
Author

Hi! Dave here. This is the actual code that we are using to randomize bones.

list is the List<T> of bones.

If you have any questions or comments about this, let us know!

@leecomp37-coder

Copy link
Copy Markdown

How is this used to manipulate the dominoes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment