How to make a 2D array show up in the GUI Box ?

The following is the 2D array that I wish to show inside of a GUI box.

       public int[,] mapArray = new int[,]{
		{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
		{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
		{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},
		{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
		{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},
		{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
		{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},
		{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
		{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},
		{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
		{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},
		{1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
		{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
	     }

I tried to use the following code but I received errors for them:

	void OnGUI() {
		for(int i = 0; i<13; i++)
		{
			for(int ii = 0; ii < 17; ii++)
			{
				GUI.Label(new Rect(10,10,80,80),mapArray[i,ii]);
			}
		}
	}

with the errors being

The best overloaded method match for `UnityEngine.GUI.Label(UnityEngine.Rect, string)’ has some invalid arguments

Argument #2' cannot convert int’ expression to type string’

Allright, it’s come to an answer!

void OnGUI() {
        for(int i = 0; i<13; i++)
        {
            for(int ii = 0; ii < 17; ii++)
            {
                GUI.Label(new Rect(i * 15, ii * 15, 15, 15), string.Format("{0}", mapArray[i,ii]));
            }
        }
    }

You might want to change the values in the Rect() a bit. You were basically drawing each and every rect over the one before it, all on the: Rect(10, 10, 80, 80) spot. By multiplying each one by it’s corresponding ‘i’ or ‘ii’ values, you should get a grid sort of thing. Hope it works!