Стан Илья Андреевич, группа 520 (ИИТ+МС) DrawSquare 5407 | Костычев Александр Михайлович, 420 DrawSquare 4933 | ||||
---|---|---|---|---|---|
f | 1 | def squares(w, h, *args): | f | 1 | def squares(w, h, *args): |
t | 2 | mtr = [['.'] * w for _ in range(h)] | t | 2 | ans = [['.'] * w for _ in range(h)] |
3 | for j0, i0, size, c in args: | 3 | for X, Y, s, c in args: | ||
4 | for i in range(i0, i0 + size): | 4 | for x in range(X, X + s): | ||
5 | for j in range(j0, j0 + size): | 5 | for y in range(Y, Y + s): | ||
6 | mtr[i][j] = c | 6 | ans[y][x] = c | ||
7 | for l in mtr: | 7 | for row in ans: | ||
8 | print(''.join(l)) | 8 | print(''.join(row)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|