I want to place the following shape in the map I created. to the top. but I couldn't find how to set up the algorithm for it.
my map ; i want to this shape:
xxxxxxxxxxxx shape = {{"T","T","T"}, xxxxxxxxxxxxxxxx
x x {" ","T"," "}}; x TTT x
x x x T x
x x x x
x x x x
xxxxxxxxxxxx xxxxxxxxxxxxxxxx
int i,j;
int heigth,width;
vector<vector<char>> board;
vector<vector<char>>shape;
vector<char>deneme;
shape = {{' ', ' ', ' ', ' '},
{' ', ' ', ' ', ' '},
{'T', 'T', 'T', ' '},
{' ', 'T', ' ', ' '}};
`
for(i=0; i<height; i++)
{
for(j=0; j<width; j++)
{
deneme.push_back(' ');
}
board.push_back(deneme);
}
for(i=0; i<width; i++)
{
for(j=0; j<height; j++)
{
if(j==0 || j==height-1)
{
board[i][j]='x';
}
if(i==0 || i==width-1 )
{
board[i][j]='x';
}
}
}