On Saturday, 22 July 2017 at 20:55:06 UTC, kerdemdemir wrote:
And what if I want to go diagonal like 1,5,9 or 3,5,7 in the example above. Is there a good solution in std without using for loops?

I suggest using an actual matrix type for tasks like this. I don't know about diagonal slicing, but the implementation here at least provides accessors for both rows and columns.

https://github.com/pineapplemachine/mach.d/blob/master/mach/math/matrix.d

Reply via email to