DrawSquare/biryukov.andrej | DrawSquare/golanger | ||||
---|---|---|---|---|---|
t | 1 | def squares(w, h, *args): | t | 1 | def squares(w, h, *fgs): |
2 | res = [['.' for i in range(w)] for j in range(h)] | 2 | f = [['.' for i in range(w)] for j in range(h)] | ||
3 | for (X, Y, s, c) in args: | 3 | for (y, x, s, c) in fgs: | ||
4 | for i in range(X, X + s): | 4 | for i in range(x, x + s): | ||
5 | for j in range(Y, Y + s): | 5 | for j in range(y, y + s): | ||
6 | res[j][i] = c | 6 | f[i][j] = c | ||
7 | for i in res: | 7 | for item in f: | ||
8 | print(''.join(i)) | 8 | print(''.join(item)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|