Jump to content

Run-length encoding: Difference between revisions

Added Uiua solution
m (→‎{{header|Wren}}: Minor tidy)
(Added Uiua solution)
 
Line 6,242:
</pre>
 
=={{header|Uiua}}==
{{works with|Uiua|0.12.0-dev.1}}
<syntaxhighlight lang="uiua">
"WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW"
Rle ← setinv(
/◇⊂≡⍚(⊂⊃(°⋕⧻|⊢))⊜□⊸(+1⊛)
| /◇⊂≡(□/⊂↯⋕∩°□:°⊟)⍉⊟∩(⊜□=1)¬,,<@A.
)
 
⨬("oops"|"good")≍&p.°Rle&p.⊸Rle&p.
</syntaxhighlight>
{{out}}
<pre>
stdout:
WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
12W1B12W3B24W1B14W
WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
 
"good"
</pre>
=={{header|UNIX Shell}}==
{{works with|bash}}
157

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.