t | def squares(w, h, *args): | t | def squares(shir, vis, *args): |
| screen = [['.' for _ in range(w)] for _ in range(h)] | | screen = [['.' for _ in range(shir)] for _ in range(vis)] |
| for square in args: | | for klet in args: |
| X, Y, s, c = square | | x, y, s, c = klet |
| for y in range(Y, Y + s): | | for i in range(y, y + s): |
| for x in range(X, X + s): | | for j in range(x, x + s): |
| if 0 <= x < w and 0 <= y < h: | | if 0 <= i < vis and 0 <= j < shir: |
| screen[y][x] = c | | screen[i][j] = c |
| for row in screen: | | for rad in screen: |
| print(''.join(row)) | | print(''.join(rad)) |