Run-length encoding: Difference between revisions
Content deleted Content added
m J: alternate implementation -- further cleanup (and rewrite) |
m Credit for others |
||
Line 1,695:
=== Alternative Implementation ===
A numeric approach, based on a discussion in the J forums (primarily [http://jsoftware.com/pipermail/programming/2015-June/042139.html Pascal Jasmin] and [http://jsoftware.com/pipermail/programming/2015-June/042141.html Marshall Lochbaum]):
<lang j> torle =: (#, {.);.1~ 1,2&(~:/\)
|