[Jprogramming] odds and nths

Lorenz Köhl rainbowtwigs at gmail.com
Thu Oct 31 16:33:23 UTC 2019


NB. get items with odd index
odd=. ] #~ 0 1 $~ #

Generalizing this I got

NB. get the nth items
nth=. ] #~ (1 ,~ 0 $~ 1 -~ [) $~ [: # ]

I bet this is not the shortest version!

I tried infix but it includes fret/fill

wrong_odd=. [: {: [: |: _2 ]\ ]

happy halloween

Lo


More information about the Programming mailing list