Array.diagonal()

From ZCubes Wiki
Jump to navigation Jump to search


Array.diagonal(nthDiagonalIndex)

Extract the diagonal at nthDiagonalIndex (-ve for diagonals below the proper diagonal, and zero for the proper diagonal).

|4|.diagonal(0..2)

|4|.diagonal(0)

|4|.diagonal(-1..1)