Жигалов Никита Сергеевич 325 DrawSquare 5087 | Багров Дмитрий Андреевич, 620 группа DrawSquare 5462 | ||||
---|---|---|---|---|---|
f | 1 | def squares(w, h, *args): | f | 1 | def squares(w, h, *args): |
n | 2 | arr = [['.'] * w for i in range(h)] | n | 2 | screen = [['.'] * w for _ in range(h)] |
3 | for el in args: | 3 | for square in args: | ||
4 | X, Y, s, c = el | 4 | X, Y, s, c = square | ||
5 | for i in range(Y, Y + s): | 5 | for i in range(Y, Y + s): | ||
6 | for j in range(X, X + s): | 6 | for j in range(X, X + s): | ||
t | 7 | arr[i][j] = c | t | 7 | screen[i][j] = c |
8 | for line in arr: | 8 | for row in screen: | ||
9 | print(''.join(line)) | 9 | print(''.join(row)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|