Open sirexeclp opened 4 years ago
Out of scope? optimizing ASCII art rendering
def _fast_print(self, text)
is not a fully-fledged part of the API, yet.I'll add some tests, rename the method (remove leading "_"), and propose a pull request here, soon.
Also, I'll try to fix the current bug that for odd-numbered line input, fast_print will ignore the last line, because of the way the lines are zipped into pairs:
>>> lines = ["line1", "line2", "line3", "line4", "line5"]
>>> line_pairs=zip(lines[::2], lines[1::2])
>>> for pair in line_pairs:
... print(f"pair: ({pair[0]}, {pair[1]})")
...
pair: (line1, line2)
pair: (line3, line4)
>>>
The Olivetti 900X in this video prints in both directions: https://www.youtube.com/watch?v=SpOyk6n5WTw Obviously this needs to be done in software, but if more than one line are to be printed and are buffered somewhere or passed to the print function, it could do just a new line , no carriage return and print the next line in reverse.