Right, sorry, I misread what you were trying to do. I didn't realize you were making spawns on *top* of the walls, and for some reason assumed they were everywhere but the walls.

Still, you can write this something like:

    val := PerlinNoise(...)
    isWall := val - Math.floor(val) < 0.05
    if wc.Y < 20 && isWall { ... }
    if wc.Y == 21 && isWall { ... }