Jelly, (削除) 12 (削除ここまで) 11 bytes
ŒJ%þ`ṪỊ§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
Updating...
ŒJ=þ`.ịS§TịFŒJ%þ`ṪỊ§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
= % - equals?modulo (vectorises)
. - literal 0.5
ịṪ - (0.5) index into (our table)tail -> [last row of table[...[x%height, first row of table]y%width,z%depth,...]...]
SỊ - sumabs(x)<=1? (column-wisevectorises)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into
Jelly, (削除) 12 (削除ここまで) 11 bytes
ŒJ%þ`ṪỊ§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
Updating...
ŒJ=þ`.ịS§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
= - equals? (vectorises)
. - literal 0.5
ị - (0.5) index into (our table) -> [last row of table, first row of table]
S - sum (column-wise)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into
Jelly, (削除) 12 (削除ここまで) 11 bytes
ŒJ%þ`ṪỊ§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
ŒJ%þ`ṪỊ§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
% - modulo (vectorises)
Ṫ - tail -> [...[x%height,y%width,z%depth,...]...]
Ị - abs(x)<=1? (vectorises)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into
Jelly, 12 (削除) 12 (削除ここまで) 11 bytes
ŒJ=þ`.ịS§TịFŒJ%þ`ṪỊ§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
Updating...
ŒJ=þ`.ịS§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
= - equals? (vectorises)
. - literal 0.5
ị - (0.5) index into (our table) -> [last row of table, first row of table]
S - sum (column-wise)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into
Jelly, 12 bytes
ŒJ=þ`.ịS§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
ŒJ=þ`.ịS§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
= - equals? (vectorises)
. - literal 0.5
ị - (0.5) index into (our table) -> [last row of table, first row of table]
S - sum (column-wise)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into
Jelly, (削除) 12 (削除ここまで) 11 bytes
ŒJ%þ`ṪỊ§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
Updating...
ŒJ=þ`.ịS§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
= - equals? (vectorises)
. - literal 0.5
ị - (0.5) index into (our table) -> [last row of table, first row of table]
S - sum (column-wise)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into
Jelly, 12 bytes
ŒJ=þ`.ịS§TịF
A monadic Link that accepts a rectangular multi-dimensional list and yields the elements that are on its "surface".
How?
ŒJ=þ`.ịS§TịF - Link: rectangular multi-dimensional list, M
ŒJ - multi-dimensional indices of M -> [[1,1,1,...],...,[height,width,depth,...]]
` - use as both arguments of:
þ - make a table of:
= - equals? (vectorises)
. - literal 0.5
ị - (0.5) index into (our table) -> [last row of table, first row of table]
S - sum (column-wise)
§ - sums (of those)
T - truthy indices (of that)
F - flatten (M) (N.B. same order as the indices produced by ŒJ)
ị - index-into