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