formatPrint function

void formatPrint(
  1. List<int> arr
)

Implementation

void formatPrint(List<int> arr) {
  List<List<int>> matrix = [];
  List<int> rows = [];

  int element;
  for (int index = 0; index < arr.length; ++index) {
    element = arr[index];
    if (index % 9 == 0) {
      stdout.writeln("\n");
      if ((index ~/ 9) % 3 == 0) {
        stdout.writeln();
      }
    }
    stdout.write('${element} \t ${(index + 1) % 3 == 0 ? "\t" : ""}');
  }
  stdout.writeln();
}