Check out example codes for "netlogo walls". It will help you in understanding the concepts better.

Code Example 1

set breadth-patches patches with[(pycor > (-(breadth)) and pycor < breadth and pxcor = lengthrec) or(pycor > (-(breadth)) and pycor < breadth and pxcor = (-(lengthrec))) ]
  set length-patches patches with[(pxcor > (-(lengthrec)) and pxcor < lengthrec and pycor = (-(breadth - 1))) or (pxcor > (-(lengthrec)) and pxcor < lengthrec and pycor = (breadth - 1))]
  set gap-patches patches with [pxcor > (gap * (-1)) and pxcor < gap and pycor =(breadth - 1)]
  set length-patches length-patches with [not member? self gap-patches]



ask breadth-patches[

sprout-walls 1[set color 2
  set size 0.5 set heading 180 fd 0.25
  if-else(pxcor < 0)[set heading 90][set heading 270] fd 0.25]
sprout-walls 1[set color 2
  set size 0.5 set heading 360 fd 0.25
 if-else(pxcor < 0)[set heading 90][set heading 270] fd 0.25]

]
  ask length-patches[

    sprout-walls 1[set color 2
      set size 0.5 set heading 90  fd 0.25
         if-else(pycor < 0)[set heading 180][set heading 0] fd 0.25
      ]
   sprout-walls 1[set color 2
     set size 0.5 set heading 270 fd 0.25
         if-else(pycor < 0)[set heading 180][set heading 0] fd 0.25
     ]
   ]  
end

Learn ReactJs, React Native from akashmittal.com