```
Random random = new Random();
for (int i = 0; i < 70; i++)
{
for (int j = 0; j < 70; j++)
{
findout[i, j] = random.Next(1,100);
}
}
string[,] positions = new string[70, 70];
for (int i = 0; i < 70; i++)
{
for (int j = 0; j < 70; j++)
{
if (findout[i, j] < d) //d is density that the user wants the maze to be filled with X's
positions[i, j] = "X";
else positions[i, j] = " ";
}
}
for (int i = 0; i < 25; i++)
{
for (int j = 0; j < 25; j++)
{
gridmaze.Text += positions[i, j];
}
}
```