Compare commits

...

3 Commits

  1. 9
      asciiWriter/utils.py

9
asciiWriter/utils.py

@ -50,3 +50,12 @@ def visit_horizontal (lines, callback, mark, blank):
def print_lines (lines):
for line in lines:
stdout.write('{}\n'.format(''.join(line)))
def translate(shape, x=0, y=0, space_char=' '):
## TODO implement a negative translation?
translated = [[] for _ in range(y)]
for line in shape:
translated.append([space_char for _ in range(x)] + line)
return translated
Loading…
Cancel
Save