Added a translate function

This commit is contained in:
Gijs de Heij 2019-12-23 18:16:25 +01:00
parent 76657435c4
commit 3ef09ab552

View File

@ -52,6 +52,7 @@ def print_lines (lines):
stdout.write('{}\n'.format(''.join(line))) stdout.write('{}\n'.format(''.join(line)))
def translate(shape, x=0, y=0, space_char=' '): def translate(shape, x=0, y=0, space_char=' '):
## TODO implement a negative translation?
translated = [[] for _ in range(y)] translated = [[] for _ in range(y)]
for line in shape: for line in shape: