private static void ColorCells <T>(Rectangle[,] cells, IRectangularReadonlyField <T> field, Func <T, Brush> getBrush)
 {
     foreach (var position in field.EnumeratePositions())
     {
         cells.GetValue(position).Fill = getBrush(field[position]);
     }
 }
        public static string ToString <T>(this IRectangularReadonlyField <T> field, Func <T, char> getSymbol)
        {
            var rows = Enumerable.Range(0, field.Size.Height)
                       .Select(x => new char[field.Size.Width])
                       .ToArray();

            foreach (var position in field.EnumeratePositions())
            {
                rows[position.Row][position.Column] = getSymbol(field[position]);
            }
            return(string.Join("\n", rows.Select(row => new string(row))));
        }