Dev.to
7/9/2026

From Turbo Pascal to TypeScript: A 35-Year-Old Maze Algorithm Comes Back to Life
Short summary
A developer recounts independently arriving at a recursive backtracking maze algorithm in 1991 Turbo Pascal by drawing branching trees, decades before it was widely cataloged. The article details porting the 35-year-old code to a TypeScript Angular component, replacing native recursion with an explicit stack to avoid browser stack overflows and separating rendering from algorithm state using a typed array occupancy bitmap. The piece is a candid engineering memoir with real code diffs showing how decades of practice improve architectural decisions.
- •Author independently discovered recursive backtracker maze generation in 1991 via visual tree-drawing, not graph theory
- •Ported Turbo Pascal code to TypeScript/Angular with an explicit stack replacing native recursion and a Uint8Array replacing pixel-based state
- •Honest about not claiming invention; credits Jamis Buck's blog series for wider recognition of the algorithm
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



