I have two dimensional array. I want to pick a slot at random, and continue to do so never picking the same slot twice until I have finally picked all slots (so nothing ran
Assuming your array is like this:
Random rand = new Random();
object[,] array = new object[width,height];
bool[,] chosen = new bool[width,height];
int i, j;
do
{
i = rand.Next(width);
j = rand.Next(height);
} while (chosen[i,j]);
chosen[i,j] = true;
object current = array[i,j];
This should work fine.