my goal for this program is to create a grid where a user navigates through it. I have so far created the grid but I am stuck on how to have it so that at any location of the array string[3,6] i can replace one of the "-" with the player symbol "P" and that every time the player moves the console will print the location of the player.
EG. i want player to start at string[2,5], the the "-" would be replaced with a "P", and that after the player moves the "-" at [2,5] returns.
But my primary focus is to find out how to replace any point of the array with the player.
Hopefully it is clear
string[,] table = new string[3,6] { {"-","-","-","-","-","-"},
{"-","-","-","-","-","-"},
{"-","-","-","-","-","-"}};
int rows = grid.GetLength(0);
int col = grid.GetLength(0);
for (int x = 0; x < rows; x++)
{
for (int y = 0; y < col; y++)
{
Console.Write ("{0} ", grid [x, y]);
}
Console.Write (Environment.NewLine + Environment.NewLine);
}
i have tried using .Replace but have had no success so far