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
  • 9,142
  • 8
  • 49
  • 93

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
  • 462
  • 4
  • 7