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