Keep on Moving 0 ▲ ronjeffries.com 1 hour ago · 9 min read1718 words · Tech · hide · 0 comments Hello, loves! We improve some code, reduce overall size and breadth of interfaces, make things better. CW: Brief LLM-“AI” remarks. I’m beginning with a review of the code around the new Connection idea, to see what can be removed and what needs improvement. I’ll show you what I spot, but spare you as many big code dumps as I can. In Cell’s # movement section, I find this nice little method: class Cell: def attempt_move(self, cell): connection = self.get_connection(cell) return connection.move() That method is used in five test checks and not used at all in production code. That’s curious. What goes on in prod? class Dungeon: def move_player_north(self): self.attempt_move_to_offset(self.player_cell, (0, 1)) def move_player_east(self): self.attempt_move_to_offset(self.player_cell, (1, 0)) def move_player_south(self): self.attempt_move_to_offset(self.player_cell, (0, -1)) def move_player_west(self): self.attempt_move_to_offset(self.player_cell, (-1, 0)) def attempt_move_to_offset(self,… No comments yet. Log in to reply on the Fediverse. Comments will appear here.