RosettaCodeData/Task/Look-and-say-sequence/APL/look-and-say-sequence-2.apl
2023-07-01 13:44:08 -04:00

5 lines
273 B
APL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

RLNS V;T
R00 ⍝ initiate empty reply
LOOP:T(=\V)V,V ⍝ t is the length of the 1st digit's run
RR,T,V ⍝ append t and the 1st digit
(0VTV)/LOOP ⍝ drop t digits and iterate