What I want to do is know if I am couting this right. I want a random char (i just have 1 because it is easy to see) and have it move around. Would I set up a random number generator and say IF the rng is 1, it would cout m+1 (moves row) and 2 is n+1 (col)? this is what I have
#include <iostream>
usingnamespace std;
int main ()
{
char map [11][11];
int m,n; //loop
for (m=0; m<11; m++ )
{
for (n=0; n<11; n++)
{
map[5][5]=(char)1;
cout<<map[m][n];
if(m==0)
cout<<"-";
elseif (m==10)
cout<<"_";
else
cout<<".";
}
cout<<endl;
}
return 0;
}
Sorry I am new to coding. Do not know how to use string, prof has not taught us that. Also is there a way i could system("cls") and loop it so you would't see the smiley there when you keep hitting it to move?