1 hour ago · 6 min read1129 words · Tech · hide · 0 comments

Hello, loves! Stepping is working. Let’s make it more nearly right. I think an object is called for. Tout le monde déteste l’IA. What, you may wonder, makes me think that we need an object? There are a few clues, and one of them is quite strong. Here’s the build_table as created in ‘main’: def make_build_table(): return [ make_diamond_in_round_room, make_a_diamond_room, make_a_round_room, make_random_rooms, finish, populate, add_content, ] This is just a list of functions, intended to be called with a Layout and a Dungeon. One clue (1) is here: this list is quite specialized inside, and yet it is just a simple list. Very special contents often suggests a special object to contain the very special contents. Here is the code, in KeyPress, fetching the list and initializing to use it: class KeyPress: def __init__(self, view, dungeon, pub_sub): from main import make_build_table # <=== self.view = view self.dungeon = dungeon self.pub_sub = pub_sub self.key_lock = None self.build_table =…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.