2 ms·
> qn:{[n],/{:[n=#x;,x;,/_f'f x,\:/:(!n)_dvl,/x]}'(f:0 -1 1+/:)@!n} bd:{[p]`0:".Q"p=\:!#p} One of the reasons golf never interested me is because people kept ma
by javajosh 13y ago
> qn:{[n],/{:[n=#x;,x;,/_f'f x,\:/:(!n)_dvl,/x]}'(f:0 -1 1+/:)@!n} bd:{[p]`0:".Q"p=\:!#p}
One of the reasons golf never interested me is because people kept making these totally inscrutable concoctions that you couldn't even take a "squinty eyed look" at. Contrast this with the rhoscript solution:
8 range permutations (with-index (sum) map uniq arg-a with-index (*exploding subtract) map uniq concatenate length) keep-maxes-by
Now, overall it's still not exactly straight-forward, but you can at least understand pieces of it right away, and start inferring things. For example, '8 range' probably constructs a range of integers (it does). The other stuff can be broken apart and tested.
By contrast that piece of K code seems actively hostile to understanding it.
- beagle3 13y agoIt's just notation. And much like math, it is very powerful, and not effectively verbalized. But just like math, it takes getting used to - and nearly impossible to go back from once you grok it.