Isolate, Test. Fix 0 ▲ ronjeffries.com 1 day ago · Tech · hide · 0 comments Hello, loves! Let’s fix the defect. Bear bite costs me two hours. First a test, basically this layout, with each number a one-cell room, added in order 0 1 2 3: 1_3_0_2 def test_ensure_connected(self): layout = DungeonLayout(7, 7) c1 = Cell(0,0) c3 = Cell(2,0) c0 = Cell(4, 0) c2 = Cell(6,0) r0 = Room([c0], '0') r1 = Room([c1], '1') r2 = Room([c2], '2') r3 = Room([c3], '3') layout.add_room(r1) layout.add_room(r3) layout.add_room(r0) layout.add_room(r2) layout.ensure_connected() assert layout.is_fully_connected() Irritatingly, this passes. Did I configure it wrong? I think I did. I confused myself with the numbers. I don’t want to tell you how long I chased this until I realized that I had made the layout, not a straight line, but a square, so there was room to draw more paths than I expected. I’m still not entirely sure how it did it. The test change: def test_ensure_connected(self): layout = DungeonLayout(7, 1) Now I can make the allegedly simple change, from: class DungeonLayout: def… No comments yet. Log in to reply on the Fediverse. Comments will appear here.