Swap array - list transform.positions

Thank You in advance!
I have a grid of instantiated gameobject’s and have tagged them as master,
I created an array from this 7x7 grid and created a list from those.
I am attempting to get the transform.positions from this list and shuffle the list and then replace the grid with the shuffled transform.positions.

 IEnumerator shuffleGrid(){
        GameObject[] gms = GameObject.FindGameObjectsWithTag ("Master");
        List<GameObject> transformsLoc = new List<GameObject>();
        foreach (GameObject gm in  transformsLoc)
           Vector3 temp = gm.transform.localPosition; //this gets the list of all  transform.positions - just no idea how to randomize the list of these
    yield return null;

I have tried many diff things from an extensive google and unity3d search but cant seem to find any good ideas.
Thank You again for any assistance

Why not simply shuffle the array itself and skip the list generation? There are several standard algorithms for that and lots of C# code on the net. For instance, there’s some options here:


… of special interest might be the answer from Matt Howells

or here…


or, here’s one that shuffles a list…


It shouldn’t be too difficult to find something that suits your needs…