This is my implementation of marching squares. Click on an empty tile to fill it, and click on a filled tile to empty it. Hold space to turn on tile view, turning off marching squares, and letting you see just the raw, unfiltered tiles.
The tile view and drawing are actually offset by half a block so they better line up with the output from marching squares.