DrawSquare/ikarona | DrawSquare/s02190253 | ||||
---|---|---|---|---|---|
t | 1 | def squares(w, h, *args): | t | 1 | def squares(w, h, *sq): |
2 | a = [['.' for i in range(w)] for j in range(h)] | 2 | field = [['.' for i in range(w)] for j in range(h)] | ||
3 | for (x, y, s, c) in args: | 3 | for (cur_w, cur_h, a, f) in sq: | ||
4 | for i in range(x, x + s): | 4 | for i in range(cur_w, cur_w + a): | ||
5 | for j in range(y, y + s): | 5 | for j in range(cur_h, cur_h + a): | ||
6 | a[j][i] = c | 6 | field[j][i] = f | ||
7 | for i in a: | 7 | for row in field: | ||
8 | print(*i, sep='') | 8 | print(*row, sep='') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|