Create multidimensional arrays by nesting:
var matrix [3][3]int
matrix[0][0] = 1
matrix[1][1] = 1
matrix[2][2] = 1
This is a x array. Access elements with two indices. Use nested loops to iterate. Each "row" is an array of ints.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Arrays of arrays
Create multidimensional arrays by nesting:
var matrix [3][3]int
matrix[0][0] = 1
matrix[1][1] = 1
matrix[2][2] = 1
This is a x array. Access elements with two indices. Use nested loops to iterate. Each "row" is an array of ints.