RosettaCodeData/Task/Run-length-encoding/Uiua/run-length-encoding.uiua

8 lines
235 B
Plaintext

# Run Length Encoding and Decoding
Rle ← setinv(
/◇⊂⍚⊂°⋕°▽
| ▽⊃⊜⋕(♭⊜∘¬)⊸∈+@0⇡10)
"WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW"
&p⨬("oops"|"good")≍&p.°Rle&p.⊸Rle&p.