[Jprogramming] J Challenge
Skip Cave
skip at caveconsulting.com
Sat Mar 5 08:43:45 UTC 2016
With Elvex & Raul's help we have...
(~.@{.,.<@(;:inv)/./) list2
┌────┬─────────────────────────┐
│bird│one eight fourteen │
├────┼─────────────────────────┤
│cow │two three five six seven │
├────┼─────────────────────────┤
│dog │four nine eleven thirteen│
├────┼─────────────────────────┤
│cat │ten │
├────┼─────────────────────────┤
│pig │twelve fifteen │
└────┴─────────────────────────┘
As Raul points out, comma with spaces are a bit more work, particularly if
you must leave off a comma after the last ID in the list. So what would be
the the verb for this?
┌────┬─────────────────────────────┐
│bird│one, eight, fourteen │
├────┼─────────────────────────────┤
│cow │two, three, five, six, seven │
├────┼─────────────────────────────┤
│dog │four, nine, eleven, thirteen │
├────┼─────────────────────────────┤
│cat │ten │
├────┼─────────────────────────────┤
│pig │twelve, fifteen │
└────┴─────────────────────────────┘
Skip Cave
More information about the Programming
mailing list