f | import numpy as np | f | import numpy as np |
| | | |
t | def squares(w, h, *args): | t | def squares(w, h, *sq): |
| array = [] | | field = [] |
| for _ in range(h): | | for i in range(h): |
| array.append(['.'] * w) | | field.append(['.'] * w) |
| screen = np.array(array) | | field = np.array(field) |
| for (X, Y, size, char) in args: | | for (x, y, sq_wh, c) in sq: |
| screen[Y:Y + size, X:X + size] = char | | field[y:y + sq_wh, x:x + sq_wh] = c |
| for line in screen: | | for r in field: |
| for char in line: | | for el in r: |
| print(char, end='') | | print(el, end='') |
| print() | | print() |