Усович Алексей, 530 группа DrawSquare 5960 | Вакуленко Георгий Константинович, 321 группа DrawSquare 5096 | ||||
---|---|---|---|---|---|
t | 1 | def squares(w, h, *squares): | t | 1 | def squares(n, m, *tuples): |
2 | field = [['.' for _ in range(w)] for _ in range(h)] | 2 | mas = [['.' for i in range(n)] for i in range(m)] | ||
3 | for square in squares: | 3 | for tup in tuples: | ||
4 | x, y, s, c = square | 4 | y, x, l, fig = tup | ||
5 | for i in range(s): | 5 | for i in range(l): | ||
6 | for j in range(s): | 6 | for j in range(l): | ||
7 | field[y + i][x + j] = c | 7 | mas[x + i][y + j] = fig | ||
8 | for row in field: | 8 | for row in mas: | ||
9 | print(''.join(row)) | 9 | print(''.join(row)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|