1

Is there a pretty way I can change my previous code:

char[][] board = Enumerable.Repeat(Enumerable.Repeat('-', 7).ToArray(), 7).ToArray();

so that it uses multidimensional arrays instead?

E.g.

char[,] = ...

the array should represent this kind of data structure:

-------
-------
-------
-------
-------
-------
-------
theonlygusti
  • 11,032
  • 11
  • 64
  • 119

1 Answers1

1
            char[,] board = new char[7,7];

            for(int i =0; i< 7; i++)
            {
                for (int k = 0; k < 7; k++)
                {
                    board[i,k] = '-';
                }
            }

Are you looking for this?

Swetha
  • 457
  • 4
  • 7