static void printPattern ( int n ) {
  int arr [ ] [ ] = new int [ n ] [ n ] ;
  int k , i , j , p = 1 , f ;
  for ( k = 0 ;
  k < n ;
  k ++ ) {
    j = k ;
    i = 0 ;
    while ( j >= 0 ) {
      arr [ i ] [ j ] = p ;
      p ++ ;
      i = i + 1 ;
      j = j - 1 ;
    }
  }
  for ( k = 1 ;
  k < n ;
  k ++ ) {
    i = k ;
    j = n - 1 ;
    f = k ;
    while ( j >= f ) {
      arr [ i ] [ j ] = p ;
      p ++ ;
      i = i + 1 ;
      j = j - 1 ;
    }
  }
  for ( i = 0 ;
  i < n ;
  i ++ ) {
    for ( j = 0 ;
    j < n ;
    j ++ ) {
      System . out . print ( arr [ i ] [ j ] + " " ) ;
    }
    System . out . println ( ) ;
  }
}

static void printPattern ( int n ) { int arr [ ] [ ] = new int [ n ] [ n ] ; int k , i , j , p = 1 , f ; for ( k = 0 ; k < n ; k ++ ) { j = k ; i = 0 ; while ( j >= 0 ) { arr [ i ] [ j ] = p ; p ++ ; i = i + 1 ; j = j - 1 ; } } for ( k = 1 ; k < n ; k ++ ) { i = k ; j = n - 1 ; f = k ; while ( j >= f ) { arr [ i ] [ j ] = p ; p ++ ; i = i + 1 ; j = j - 1 ; } } for ( i = 0 ; i < n ; i ++ ) { for ( j = 0 ; j < n ; j ++ ) { System . out . print ( arr [ i ] [ j ] + " ▁ " ) ; } System . out . println ( ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (identifier))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (identifier))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (string_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list)))))))