How greentec/mazes-for-programmers-js works
Core Components Layer
• Cell (Base class) at the center
• Grid (Base class) connected to Cell
• Distances class for pathfinding calculations
These form the foundation of all maze operations.
Grid Variations Layer
Specialized grid types branching from the base Grid:
• ColoredGrid
• WeightedGrid
• MaskedGrid
• PolarGrid
• HexGrid
• TriangleGrid
• WeaveGrid
• Grid3D
Cell Variations Layer
Specialized cell types branching from the base Cell:
• WeightedCell
• PolarCell
• HexCell
• TriangleCell
• WeaveCells
• Cell3D
Algorithm Layer
Maze generation algorithms into categories:
a. Basic Algorithms:
• BinaryTree
• SideWinder
b. Random Walk Algorithms:
• AldousBroder
• Wilsons
• HuntAndKill
c. Advanced Algorithms:
• RecursiveBacktracker
• Kruskals
• Prims
• Ellers
• RecursiveDivision
• GrowingTree
Utility Components
• Mask class for cell filtering
• Demo implementations (HTML files)
• Blue: Core components
• Green: Grid variations
• Yellow: Cell variations
• Red: Algorithms
• Gray: Utilities
Key Design Principles to Highlight:
Inheritance Hierarchy: Show how specialized grids and cells inherit from base classes
2. Algorithm Independence: Illustrate how maze generation algorithms are separate from grid/cell implementations
Visualization Layer: Show how the HTML demos connect to the core components
Important Notes:
• Related algorithms together (e.g., random walk-based algorithms)
• How the visualization layer (HTML files) connects to the core components
Level of Detail:
• Keep implementation details (methods, properties) hidden
• Component relationships and data flow
• Pluggable nature of the algorithms
• Clear separation between core infrastructure and specific implementations