Arranging objects in random rows and columns

in theory, add all objects to an array A and shuffle it. (or shuffle an integer array and use it as and index)

Then you can just make a nested for-loop and add consecutively from the list A

int k=0; 
for (int rowNumber = 0; rowNumber < 6...{
   for (int colNumber = 0; colNumber < 8... {
       pieces[colNumber, rowNumber ] = A[k];
       k++;
   }
}

For a similar shuffle example see Can someone help me with this game? - #4 by Chrisir

Hey, and welcome to the forum!

Great to have you here!

Warm regards,

Chrisir