Q: How to associate string elements (possibly in an array) with a grid index in c# [unity3d] There is a 2d grid for example 7(column)x16(row).
A total of 111 cells are obtained with an index from 0 to 111.
Along the perimeter of this grid are 7 numbers and 16 letters.
I want to refer to the index of each individual cell not by their number, but for example using the text field to send commands 1a, 2b, 3c, etc.
I introduced it so that the string element of the array - "numbers[0]" and "letters[0]" will be equal to the original cell of the grid with the number 0.
Then it turns out to associate the elements of the arrays with the grid index it will be necessary to add +1 to the string element "letters[0] -> letters[1]" in the case when the value of the grid row does not change, but the column changes (for example, 1a -> 1b).
And in this case, add +16 to the value of the previous row of the grid (1a -> 2a).
I tried to create two one-dimensional arrays "numbers[]" and "letters[]" with a cycle for, but I had a problem, and how to actually associate the data of this array with the cell index if I know the number of columns and rows of the grid.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GridsNL : MonoBehaviour {


public int indexCellStart;
private int countRow;
private int countColumn;



// Use this for initialization
void Start () {

    Grid grid = Grid.instance;
    countRow = grid.rowCount;
    countColumn = grid.columnCount;
    CreateArray();   
}


// Update is called once per frame
void Update () {

}



public void CreateArray()
{

    int[] numbers = new int[countRow];

    for (int countRow = 0; countRow < numbers.Length; countRow++)
    {

        //Debug.Log(countRow);

    }

    string[] letters = new string[countColumn]

    for (int countColumn = 0; countColumn < letters.Length; 
    countColumn++)
    {

        //Debug.Log(countColumn);

    }



    }

I understand that maybe I need to use some kind of cyclic construction inside an array.

A: I would either use a multidimensional array like e.g.
string[,] stringArray = new string[rowCount, columnCount];

which you later access e.g.
for(int r = 0; r < rowCount; r++)
{
    for(int c = 0; c < columnCount; c++)
    {
        var certainValue = stringArray[r, c];

        ...
    }
}


Or alternatively if you want a one dimensional array 
string[] stringArray = new string[rowCount * columnCount];

And iterate over it like e.g.
for(int r = 0; r < rowCount; r++)
{
    for(int c = 0; c < columnCount; c++)
    {
        var certainValue = stringArray[r * columnCount + c];

        ...
    }
 }


Those would not be accessed by something like 2c but it makes little sense in the end and you should stick to those int indexes instead ...
If you really want letters you might want to try e.g.
char someExampleChar = 'e'; // what you get from the InputField
int indexInt = (int) someExampleChar - (int) 'a';

which converts the char value to a 0 based index.
As a simple Extension method like
public static class CharExtensions
{
    public static int ToIndex(this char character)
    {
        return (int) character - (int) 'a';
    }
}

Then you can simply use
char someExampleChar = 'f';
int index = someExampleChar.ToIndex();


Typed on smartphone so no warranty but I hope the idea gets clear
