Array.diagonal()

From ZCubes Wiki
Revision as of 11:44, 10 April 2020 by Joseph (talk | contribs) (→‎Array.diagonal(nthDiagonalIndex))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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)