static matrixToString(matrix) {
    let str = '';

    for (var i = 0; i < matrix.length; i++) {
      for (var j = 0; j < matrix[i].length; j++) {
        str += matrix[i][j] + ' ';
      }

      str += '\n';
    }

    return str;
  }
Creates a printable string from a matrix (2D array).

@param {Array[]} matrix A 2D array.
@returns {String} A string representing the matrix.