142 days ago · Tech · hide · Fediverse post

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…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town