Alright, say you go over all the xy elements (for each xy element), and check what the value was (current value), and suppose we say if that value was one then there should be a wall there.... easy right?
Now what if you do compare at xy, and compare what the value was for the next xy, or cell? Say for example current x +1, and current y.
What cell would that be?
What would current x, and current y+1 be?
Current x-1, and current y?
Current x, and current y-1?
Wouldn't that essentially check all 4 cells around the current cell?
And say what if one of those cells returned the value of zero instead of 1.
Would that give you any ideas as far as what to do?