Question: I'm using a multidimensional array to create a "border". If it was printed, it would look something like this:

```
######
#    #
#    #
#    #
######

```

The code I have so far can create the top, left, and bottom borders. At the moment I don't know how to create the border for the right hand side of it.

```
int[,] array = new int[10, 10];
//Create border around box
//Top
for (int i = 0; i < array.GetLength(0); i++)
{
    array[0, i] = 1;
}

//Bottom
for (int i = 0; i < array.GetLength(0); i++)
{
    array[array.GetLength(0) - 1, i] = 1;
}

//Left
for (int i = 0; i < array.GetLength(0); i++)
{
    array[i, 0] = 1;
}

```

How do I go about creating the border on the right? Also, I think my code could be improved, I'm new to C#.

Thanks

Answer: 
Since all the for loops have the same bounds why not do it in one loop like this:

```
 for (int i = 0; i < array.GetLength(0); i++)
        {
        //Top
            array[0, i] = 1;
        //Bottom    
        array[array.GetLength(0) - 1, i] = 1;
        //Left
        array[i, 0] = 1;
        // Right
        array[i, array.GetLength(0) - 1] = 1;
        }

```
```
int x = 10;
int y = 10;
int[,] array = new int[x, y];

  // iterate over the left coordinate
foreach(int i in Enumerable.Range(0, x))
{
  array[i,0] = 1;    //bottom
  array[i,y-1] = 1;  //top
}

  // iterate over the right coordinate
foreach(int i in Enumerable.Range(0, y))
{
  array[0,i] = 1;    //left
  array[x-1,i] = 1;  //right
}

```