From the video "How does DOOM avoid drawing what's behind walls?" (How Games Are Made, FPS history 2/3). A simplified model with only walls of the same height that you cannot see through (not a re-implementation of all of DOOM).
What it does: it projects each wall onto a span of screen columns (a to b) — the column comes from the ratio of sideways position to depth as seen from the camera — and sets the height of each column in the span from the distance to the wall. "Skipping" walks a BSP tree (a tree that keeps splitting the map in two with lines) starting from the side nearer the viewer, so near walls are processed first. It records "filled columns" in an array of 320, and skips filled columns.
"No skipping" walks the same tree from the far side, processes every wall span and draws over it. If the "different columns" count, comparing the two pictures column by column, is 0, the same picture was made with less work.
Arrow keys ← → to turn, ↑ ↓ to walk (on a phone, drag the screen).
AI was used to make the diagrams and code. No game footage is used. Sources are in the video description.