I have a project on pseudographics, but I didn’t like the rendering implementation. So I decided to use curses. I wrote the code, but it doesn't work the way I wanted. Here is what I wanted to get: https://savepice.ru/full/2019/4/6/0f64ff4eaa1f12957a74f2fd94e18ee9-full.jpg.html
Here is the result: https://savepice.ru/full/2019/4/6/1882edc14db8bf78
Here is the code:
def render(self, stdscr): bl = "||" bt = "=" * (len(self.scene_obj.scene["place"][0]) * 2 + len(bl) * 2) cols = 1 rows = 4 stdscr.clear() stdscr.addstr(1, 1, "Step: " + str(self.scene_obj.scene["count"])) stdscr.addstr(1, 3, bt) for row in self.scene_obj.scene["place"]: stdscr.addstr(cols, rows, bl) cols = len(bl) cols += 1 for col in row: stdscr.addch(cols, rows, col.symbol, col.color) stdscr.addch(cols + 1, rows, " ") cols += 2 stdscr.addstr(cols, rows, bl) cols = 1 rows += 1
render
method, and provide its code here. Then it will be possible to pootkladivat. - Sergey Nudnov am