feat: BSP dungeon generation with 2D ASCII tile map

Replace list-based room display with proper 2D tile map using Binary
Space Partitioning. Rooms are carved into a 60x20 grid, connected by
L-shaped corridors, and rendered with ANSI-colored ASCII art including
fog of war visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 00:57:16 +09:00
parent 92741d415d
commit 26784479b7
5 changed files with 490 additions and 54 deletions

View File

@@ -40,3 +40,19 @@ func TestRoomTypeProbability(t *testing.T) {
t.Errorf("Combat room probability: got %.1f%%, want ~45%%", combatPct)
}
}
func TestFloorHasTileMap(t *testing.T) {
floor := GenerateFloor(1)
if floor.Tiles == nil {
t.Fatal("Floor should have tile map")
}
if floor.Width != 60 || floor.Height != 20 {
t.Errorf("Map size: got %dx%d, want 60x20", floor.Width, floor.Height)
}
// Current room should have floor tiles
room := floor.Rooms[0]
centerTile := floor.Tiles[room.Y+room.H/2][room.X+room.W/2]
if centerTile != TileFloor {
t.Errorf("Room center should be floor tile, got %d", centerTile)
}
}