turf
wall
density=1
icon='wall.dmi'
proc/Update()
var/state=0
for(var/turf/wall/W in get_step(src,NORTH))
if(W)
state+=1 //wasn't sure if the constants would give the right icon states.
break
for(var/turf/wall/W in get_step(src,SOUTH))
if(W)
state+=2
break
for(var/turf/wall/W in get_step(src,WEST))
if(W)
state+=4
break
for(var/turf/wall/W in get_step(src,EAST))
if(W)
state+=8
break
src.icon_state="[state]"
New()
..()
for(var/turf/wall/W in view(1))
W.Update()
Problem description: The problem, short and simple, the icon states don't change.
Simply, you are trying to search for turfs in the contents of another turfs, and we know that's not possible. Only one turf is able to be in one tile. So basically "state" will never budge. Also, the if(W) statement is not needed.
Here's an example of what could simulate what you are trying to do:
Or to make it more efficient for your own needs, you could do this.
~~> Dragon Lord