18 Mar
2022
18 Mar
'22
1:20 p.m.
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.