I am working on something and i am stuck. I need to make a 5 x 5 square grid. i need to add character in it. Like
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
5x5 grid
I need to add a character in it and move it by taking input from user(u,d,l,r) like
p * * * * User enter d --> * * * * *
* * * * * p * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
I have no clue how i will add this in a grid.I made grid by this method.
{
int s = 5;
for (int i = 1; i <= s; i = i + 1){
for (int j = 1; j <= s; j = j + 1){
cout << " *";
}
cout << endl;
}
Now if i add p with * it prints p with all *. Can anyone put me in right direction? That will be great. Thanks.