Wolfenstein and Doom faked 3-D on a machine that couldn’t do it: from a flat map, cast one ray per screen column, measure how far to the wall, and draw a slice as tall as the wall is near. A whole corridor from a grid and a little trigonometry. Turn (or tap) and walk the walls.
Grid raycasting, the Wolfenstein-3D engine. From the player's position, cast one ray per screen column across a field of view; a DDA (digital differential analyser) steps the ray cell by cell until it hits a wall, giving the exact distance. A wall slice is drawn with height ∝ 1/distance (nearer = taller), and the perpendicular distance is used so straight walls stay flat (no fisheye). It is real trigonometry faking a third dimension. A fail-loud self-check throws unless a ray fired straight at a wall a known distance away returns that distance.
A small fixed grid map, axis-aligned walls, flat shading (real engines add textures, sprites, floors); FOV and step count are illustrative. The DDA traversal and the 1/distance projection are computed exactly.