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