A simple ASCII dungeon generator that creates procedurally generated dungeons with rooms, hallways, and an entrance.
node index.jsYou can customize the dungeon by passing command-line arguments:
node index.js width=50 height=30 roomCount=8Available options:
width- Dungeon width (default: 40)height- Dungeon height (default: 20)roomCount- Number of rooms to generate (default: 5)wallsChar- Character for walls (default: "#")emptyChar- Character for empty spaces (default: " ")doorChar- Character for doors (default: "+")entranceChar- Character for entrance (default: "E")
The generator creates a grid filled with walls, then:
- Randomly places rooms of varying sizes
- Creates a main horizontal hallway connecting all rooms
- Connects each room to the hallway with corridors and doors
- Places an entrance on the left side of the hallway