This is to help people like me who can't remember how to get the column list of a 2 dimensional matrix
Every now and then, I need to get all the items in a column in a matrix and I spend from 5 to 15 minutes trying to remember the syntax - I think this could do with an explicit block in the list utilities library
I think it would especially be helpful to young learners - the more complicated stuff on page 20 of the manual would still be there for anyone who needs to do more
This is what I came up with today (which obviously could do with improvement)
So as to not pollute a galaxy far, far away I'd like to return to this topic in the forum
The way I look at it is - we have the
block for fetching an item in a list
And when the list is a 2D matrix - it returns a row from the matrix.
All good - all well - simple to understand
BUT, if we want to extract a column from a matrix we have to use
which is explained in the manual but is not intuitive syntax- well not to me anyway
So my original request was to have an addition to the List library (so as not to clutter up the standard blocks) that looks like this
Now there has been some discussion on this on Github but it doesn't look as if a simple column reporter block is going to be part of Snap! primitives so I'm re-requesting that it be included in the List library
This request comes about from my recent experiences in the Advent of Code puzzles - a lot of which require 2D (or even 3 and 4D matrix operations)
Although extracting 1 column using map isn't too bad - I think an explicit column reporter comes into i's own when more than 1 column is required