WindowManager
class WindowManager {
public:
vector <string> screen(int height, int width, vector <string> windows) {
vector <string> result;
stringstream ss;
int lx,ly,rx,ry;
char c;
result.clear();
string s;
s.clear();
s = "";
// cout << width << "," << height << endl;
for(int a=0;a<width;++a) s += " ";
for(int b=0;b<height;++b) result.push_back(s);
for(int i = 0;i<windows.size();++i) {
ss.str(windows[i]);
ss >> ly >> lx >> ry >> rx >> c;
rx += lx -1;
ry += ly -1;
for(int y=0;y<height;++y) {
for(int x=0;x<width;++x) {
if((x==lx && y==ly) ||(x==lx && y==ry) ||(x==rx && y==ly) ||(x==rx && y==ry)) {
result[y][x] = '+';
}
else if(((x == lx)||(x == rx)) && (y > ly) && (y < ry)) {
result[y][x] = '|';
}
else if(((y == ly)||(y == ry)) && (x >lx) && (x < rx)) {
result[y][x] = '-';
}
else if((x >lx) && (x < rx) && (y > ly) && (y < ry)){
result[y][x] = c;
}
}
}
ss.str("");
ss.clear();
}
return result;
}
};