From 8ac28a47f494d2a7989f1aead4c973cdf8f8bdb3 Mon Sep 17 00:00:00 2001 From: KikooDX Date: Wed, 6 Nov 2019 09:53:02 +0100 Subject: [PATCH] Made a test version of fancy display for Screen. --- locate2.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/locate2.py b/locate2.py index 66e4bb9..0d4cd74 100644 --- a/locate2.py +++ b/locate2.py @@ -28,16 +28,19 @@ class Screen: def fill(self, patern=" "): self._mat = [[patern[0] for i in range(self._width)] for i in range(self._height)] - def refresh(self, ask_for_input=True, endl="\n"): + def refresh(self, ask_for_input=True, endl="\n", fancy=False): to_print = str() - for line in self._mat: + for line in self._mat[:-1] if fancy else self._mat: for cell in line: to_print += cell to_print += "\n" to_print = to_print[:-1] print(to_print) - if ask_for_input: - return input("> ") + if ask_for_input or fancy: + line = "" + for cell in self._mat[-1][:-1]: + line += cell + return input(line if fancy else "> ") else: print("", end=endl) return None