[ot|[spam][crazy] Struggles with OOP and Trees

Undiscussed Horrific Abuse, One Victim of Many gmkarl at gmail.com
Fri Mar 18 06:20:58 PDT 2022


What's a barebone's ascii display class in python?

import os

class Display:
  def __init__(self, cols = os.environ.get('COLUMNS', 80), lines =
os.environ.get('LINES', 50):
    self.backbuffer = np.full((cols, lines), ' ')
  def clear(self):
    self.backbuffer = ' '
  def plot(self, x, y, char='X'):
    self.backbuffer[x,y]=char
  def blit(self):
    for line in self.backbuffer:
      print(''.join(line))

It could be greatly improved.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/html
Size: 862 bytes
Desc: not available
URL: <https://lists.cpunks.org/pipermail/cypherpunks/attachments/20220318/b4559b6b/attachment.txt>


More information about the cypherpunks mailing list