I have been stumped trying to figure how to locate and change the values of the area bordered around a single element of an list without affecting the element values needing to be bordered.
This is what I'm trying to achieve:
BEFORE:
[[0,0,0,0,0],
[0,1,1,0,0],
[0,1,0,1,0],
[0,0,1,0,0],
[0,0,0,0,0]]
AFTER:
[[9,9,9,9,0],
[9,1,1,9,9],
[9,1,9,1,9],
[9,9,1,9,9],
[0,9,9,9,0])
I just need to know if I need mainly for
loops as well as if/else
statements, or if I need a separate library to get this solved.
Thanks in advance for helping!