> -----Oorspronkelijk bericht----- > Van: Programming <programming-boun...@forums.jsoftware.com> > Namens Skip Cave > Verzonden: donderdag 24 oktober 2019 08:36 (...) > > Is there a way to do this search without explicit looping? > > > Skip >
Yes. Consider <@(<\.)\i.5 ┌───┬───────┬─────────────┬─────────────────────┬───────────────────────────────┐ │┌─┐│┌───┬─┐│┌─────┬───┬─┐│┌───────┬─────┬───┬─┐│┌─────────┬───────┬─────┬───┬─┐│ ││0│││0 1│1│││0 1 2│1 2│2│││0 1 2 3│1 2 3│2 3│3│││0 1 2 3 4│1 2 3 4│2 3 4│3 4│4││ │└─┘│└───┴─┘│└─────┴───┴─┘│└───────┴─────┴───┴─┘│└─────────┴───────┴─────┴───┴─┘│ └───┴───────┴─────────────┴─────────────────────┴───────────────────────────────┘ and ;<@(<\.)\i.5 ┌─┬───┬─┬─────┬───┬─┬───────┬─────┬───┬─┬─────────┬───────┬─────┬───┬─┐ │0│0 1│1│0 1 2│1 2│2│0 1 2 3│1 2 3│2 3│3│0 1 2 3 4│1 2 3 4│2 3 4│3 4│4│ └─┴───┴─┴─────┴───┴─┴───────┴─────┴───┴─┴─────────┴───────┴─────┴───┴─┘ and observe that all consecutive subsets occur. R.E. Boss ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm