I have and Two dimensional array like this.
[A] [B] [C]
[D] [E] [F]
[G] [H] [I]
And I want a function that receive a string as parameter and return an array int[,] with a position of each Word of that string.
public int[,] GetPosition(string Word)
{
int[,] coordenadas = new int[1, Word.Length];
for (int value = 0; value < Word.Length; value++)
{
char letra = Word[value];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
if (array[i, j].Equals(letra.ToString()))
{
coordenadas[0, j] = //??
}
}
}
}
Then I call that function with a Word like GetPosition("GEI")
It has to return an array {{3,1},{2,2},{3,3}}
How can I build an int[,] with every position?
List<T>of type custom class and populate the properties of each object to correspond to the position in your letter array for the given word and.Addthem to theList<T>which could be returned