function drip(ground, source) {
const queue = [ source ]
const seen = {}
let n = 0
while (queue.length) {
const p = queue.shift(),
[x, y] = p
if (y > extent[1])
break
if (p in seen)
continue
seen[p] = true
if (!(p in ground) || ground[p] === '|') {
let dx = Math.sign(Math.random() - 0.5)
ground[p] = '|'
queue.unshift([x, y+1], [x+dx, y], [x-dx, y])
}
}
return ground
}