[ot][spam][crazy][is it appropriate to direct disruption towards things that have been heavily disrupted?]

Undiscussed Horrific Abuse, One Victim of Many gmkarl at gmail.com
Wed Jun 22 07:19:02 PDT 2022


i put it in a class for object-orientedness. this makes it seem bigger
textwise. then i derived from the class to draw the text centered now.

here's the class:

class Engine:
    def run(self):
        curses.wrapper(self.__run)
    def __init(self):
        self.window.nodelay(True)
        self.window.clear()
    def __run(self, window):
        self.window = window
        self.__init()
        while True:
            self.update(self.__update())
    def plot(self, x, y, str):
        line = round(y / self.char_height)
        row = round(x / self.char_width)
        self.window.addstr(line, row, str)
    def __update(self):
        # getting a key also refreshes
        try:
            key = self.window.getkey()
        except:
            key = ''
        # wipe for next draw
        self.cols = curses.COLS
        self.lines = curses.LINES
        self.char_width = 8
        self.char_height = 16
        self.width = self.cols * self.char_width
        self.height = self.lines * self.char_height
        self.window.erase()
        return key


More information about the cypherpunks mailing list